Reputation: 1411
I have few css i can't remove strange space between top and header.
container.css
display: table;
height: 100%;
Inside i have
header.css
text-align: center;
width: 90%;
padding: 0px;
Setting padding and margin to 0 is not working for some reasons.
Only one way to move header that i found is changing
margin-top: 0px;
Bug it doesn't change until i change to -22.
If i change it to -23(exactly -23) then it moves out of page like this :
Can someone help find the reason? Thank you for assistance.
fiddle - try to change margin-top of header
Upvotes: 1
Views: 145
Reputation: 363
In HTML some elements come with their own margin and padding. To remove this default margin, padding we should "reset css".
Add following code in your css
*{
margin:0;
padding:0;
}
Check if it helps :)
star (*) is universal selector. It'll reset all elements margin and padding.
Upvotes: 0
Reputation: 9022
Both your menu and your content are treated as table-cells. Add
.main-box { vertical-align: top; }
to your CSS to get rid of the auto margin.
Upvotes: 1