Answer by Deathstorm for Giving background-color to body applying whole page....
it's actually pretty logic. First of all <html> and <body> tags are required tags in a webpage. Where the <html> tag contains all of the <html> code the <body> tag holds...
View ArticleAnswer by Paolo Forgia for Giving background-color to body applying whole...
The main reason is because the HTML takes the background-color of BODY since: The background of the root element becomes the background of the canvas and covers the entire canvas [...] So since the...
View ArticleAnswer by Ehsan for Giving background-color to body applying whole page. Why?
height you see in inspect is min-height That is equal height's element div, background-color change max-height That is equal 100% his parents(html). For Example: change min-height and run inspect and...
View ArticleAnswer by itacode for Giving background-color to body applying whole page. Why?
CSS tricks has a related post in merit link . It seems that body styles are expanded to html because: html is the root element of a document where body is a descendent contained within it. In fact,...
View ArticleAnswer by Lahiru Madusanka for Giving background-color to body applying whole...
Body means all page that display in the browser. so you want give color only to div you can use either a id or a class to give a style to that dive. as in first answer. <body> <div...
View ArticleAnswer by Exprator for Giving background-color to body applying whole page. Why?
.some{ background-color: red; } <div class="some">Hello World!</div> try this, as if you give color to body the whole webpage will be colored
View ArticleGiving background-color to body applying whole page. Why?
body { background-color: red; } <body> <div>Hello World!</div> </body> So the background-color: red; applies to whole page height but when I inspect the page the height of the...
View Article