Replies: 4 comments 4 replies
-
If I understand your problem correctly, I think you are using max-width incorrectly. Max-width is a limiting factor, ie. it can never make your element exceed an explicit width. Between
width will govern, when the parent exceeds 500px. When the parent is less than 500px, your element is taking a max width of 100% of its parent. Let me know if that makes sense or if I am misunderstanding the question. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I think your problem is because max-width does not inherit from parent elements. As it is, max-width will always be ignored, and with 500px is being applied. |
Beta Was this translation helpful? Give feedback.
-
@werner33 @herbalite Okay, both your answers make sense... |
Beta Was this translation helpful? Give feedback.
-
Converted this to a discussion since it's an open-ended how-to/troubleshooting question. :) |
Beta Was this translation helpful? Give feedback.
-
Hello, I have a weird issue where a child element of a
.col
that has both a width:500px max-width:100% will kind of ignore the max-width at a critical responsive width where the child element should instead max-width 100% to its parent's width (.col)HTML
CSS
Here is an example : https://jsfiddle.net/nywj82co/ (try playing with the viewport's width)
Any idea how to fix this issue ?
Beta Was this translation helpful? Give feedback.
All reactions