3 ms·
Thats a genius idea for making sure none of the elements goes our of viewport width. I always had this issue that a div has standard border padding, and width:1
by davchana 9y ago
Thats a genius idea for making sure none of the elements goes our of viewport width. I always had this issue that a div has standard border padding, and width:100% pushes its right to out of viewport. Can't wait to try this.
Just few genuine questions, as I am learning, specifically in making static fixed header bars for few of my fun projects.
Does the meta tag in ur comment needs closure(>), or is it something I might have never come across?
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 %?
- 4lun 9y ago> I always had this issue that a div has standard border padding, and width:100% pushes its right to out of viewport. You likely want `box-sizing: border-box`: https://www.paulirish.com/2012/box-sizing-border-box-ftw/ https://www.paulirish.com/2012/box-sizing-border-box-ftw/
- 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.