Reputation: 16224
I need to Positioning a DIV tag in top of the page like in the StackEchange top menu bar
i used to following code but there is the space
div.topbar{
width:100%;
background:#C0C0C0;
border:1px;
border-color:gray;
border-style:solid;
text-decoration:none;
font-family:Arial;
top:auto;
}
Upvotes: 1
Views: 34122
Reputation: 19450
position: absolute
is not needed if is the first child of the containing element. Just do a
margin: 0
padding: 0
and you'll have the added benefit of the next element in the flow positioned correctly after and not under the top bar.
Upvotes: 2
Reputation: 993
Did you try adding position:absolute;
and top:0;
?
You may need to clear:both;
the next element, though.
Upvotes: 0