How To Set The Background Color Of The Whole Page In Css
Solution 1:
The body's size is dynamic, it is only as large as the size of its contents.
In the css file you could use:
* {background-color: black}
// All elements now have a black background.
or
html {background-color: black}
// The page now have a black background, all elements remain the same.
Solution 2:
<html><head><title>
webpage
</title></head><bodystyle="background-color:blue;text-align:center">
welcome to my page
</body></html>
Solution 3:
The problem is that the body of the page isn't actually visible. The DIVs under have width of 100% and have background colors themselves that override the body CSS.
To Fix the no-man's land, this might work. It's not elegant, but works.
#doc3 {
margin: auto 10px;
width: auto;
height: 2000px;
background-color: yellow;
}
Solution 4:
I already wrote up the answer to this but it seems to have been deleted. The issue was that YUI added background-color:white
to the HTML element. I overwrote that and everything was easy to handle from there.
Solution 5:
I've checked your source code and find to change to yellow you need to adds the yellow background color to : #left-padding, #right-padding, html, #hd, #main and #yui-main.
Hope it's what you wanted. See ya
Post a Comment for "How To Set The Background Color Of The Whole Page In Css"