Skip to content Skip to sidebar Skip to footer

Why Does Inline-block And Max-width Not Work Together?

Just started learning CSS/HTML. I am creating a site for educational purposes. I am also terrible at explaining things so I hope you understand. SITE: http://66.172.10.179/resolver

Solution 1:

The max-width property doesn't imply any specific width. Instead, it limits the possible values of the width property.

Setting display to inline-block implies no specific width, but block (which is the default for <div> elements) implies 100% width.

To answer your question, max-width and inline-block do work together.

If your goal is to prevent the element from growing beyond the browser width, you want max-width: 100%.

Post a Comment for "Why Does Inline-block And Max-width Not Work Together?"