3 ms·
> I always had this issue that a div has standard border padding, and width:100% pushes its right to out of viewport. What you probably want, in addition to th
by nfriedly 9y ago
> I always had this issue that a div has standard border padding, and width:100% pushes its right to out of viewport.
What you probably want, in addition to the max-width, is
box-sizing: border-box;
Then the border is included in the width calculation.
> Does the meta tag in ur comment needs closure(>), or is it something I might have never come across?
If you're writing XHTML, then you need to end the tag with /> instead of >. But for HTML5, it's valid as is. And browsers get it right either way.
> Does implying a max-width 100 in percentage means every element gets max 100% of "its" parent element, which can be traced down back to HTML as super parent of all tags, and thus if I could use "vw" viewport width as units instead of %?
That's a good question. I'm not familiar with the vw unit, but yea, that sounds basically right.