DEV Community

Discussion on: Understanding gatsby-image (Part 3): Controlling sizes, breakpoints and styling

Collapse
 
asdfcodes profile image
asdf-codes

Hey! <3 the content, especially someone like me who is just starting out. It seems like Gatsby image mostly relies on width when displaying an image. How would one go about setting a max-height and leaving max-width the same?

Collapse
 
alexabruck profile image
Alexa Steinbrück

Oh, you can also just pass max-height in the style property (might add an !important to it too), haven't tested it yet..

Collapse
 
alexabruck profile image
Alexa Steinbrück

Hi! If you want to change the height of the image you could give the element a style property and set a paddingBottom property. Hope that helps!