Good morning,
When I use Markdown and I want to add an image, I just drag it from the resources directly into the Markdown document. But how can I make the images smaller? What command do I need to enter for that?
Mike
Good morning,
When I use Markdown and I want to add an image, I just drag it from the resources directly into the Markdown document. But how can I make the images smaller? What command do I need to enter for that?
Mike
do you mean visually smaller, or do you want to resize the actual image?
I created a custom HTML component and added some styling, such as:
/* Set max image width for smaller screens and centre in markdown content*/
.markdown-content img {
max-width: 90%;
display: block;
margin-top: 12px;
margin-bottom: 12px;
margin-left: auto;
margin-right: auto;
}
/* Set max image width for larger screens and centre */
@media (min-width: 768px) {
.markdown-content img {
max-width: 600px;
max-height: 600px;
display: block;
margin-top: 20px;
margin-bottom: 20px;
margin-left: auto;
margin-right: auto;
}
}
Obviously, you can change the max sizes accordingly (either a percentage, as I have done for smaller screens or a pixel width and height for larger). Margin-left and margin-right set to auto centre the image.
Then, add the CSS class (in this example, the class is markdown-content) to the markdown container in the advanced section of the inspector.