DEV Community

Discussion on: Responsive text based on image size

Collapse
 
lelegm profile image
lelegm

Sounds great! Anyway, it doesn't work if I resize my image manually in CSS with max-width: 50%. In that case, is the paragraph/heading below to dictate div size.

Collapse
 
afif profile image
Temani Afif

you should not apply max-width:50% to the image. This doesn't make sense because the 50% will be the image size since it's inside a inline-block container. the max-width:50% should be applied to the parent element instead