开发者

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;
 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜