The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › max-width
Hello, I don’t understand the difference between max-width alone and max-width with width:100%. If we tell about responsive layout, it is better to write:
width:100% max-width: 900px
or only:
max-width: 900px
Or there is not difference? Thanks and regards..
No Difference, unless someone can tell me otherwise.
I do write
max-width:1200px; width:100%;
Thank you very much..
If the element is a div for example (with default positioning and block level display), it will automatically have a width of 100% anyway…
div
Of course if the element is absolutely positioned, it will need the width to be declared explicitly.
Edit:
default positioning
Or relative…
Thanks Shikkediel..