How can I make a bar flush with the top, left, and right of a browser window in CSS?
I want to make a bar at the top of my site si开发者_如何学JAVAmilar to the one on stackoverflow or facebook. I have the following code:
#topBar {
background-color: #3B5998;
height: 41px;
left: 0;
width: 100%;
z-index: -1;
}
There seems to be a white region surrounding the bar in my browser. How can i remove that surrounding area? Border,padding, and margin are all 0.
You need to set the margins and padding on the body to 0.
body{
margin:0px;
padding:0px;
}
精彩评论