100% margin. Still a margin

Dobby

Member
Nov 8, 2010
156
5
Okay so i am making a website and i have two divs both of which have a margin of 100%. i managed to get the first div to work but the second one isnt having any of it.

#header1 {
background-color:#000;
width:100%;
height: 50px;
position: absolute;
top: 0;
left: 0;
color:#FFF;
font-size:13px;
}
#navigation {
background-color:#000;
width: 100%;
height: 100px;
margin-top: 42px;
display: inline-block;
background-image: -webkit-linear-gradient(top,#333333,#222222);
background-image: -o-linear-gradient(top,#333333,#222222);

}

Any ideas?
 

Sysode

Front-End Developer
Dec 11, 2012
1,673
848
1) read back what you've written and try and make it make some sorta sense
2) Do you width instead of margin?
3) What are you trying to achieve, you attempt to say a problem but we don't know what it's about..

Do this and then we could help ;p
 

Dobby

Member
Nov 8, 2010
156
5
Okay ill try explain it a little better. I am working on a website that has two <div> that have a width of 100% (so it goes all the way across) i have managed to get the first part header1 to work but navigation still has what looks like a margin. Is that explained any better?
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,638
2,393
Okay ill try explain it a little better. I am working on a website that has two <div> that have a width of 100% (so it goes all the way across) i have managed to get the first part header1 to work but navigation still has what looks like a margin. Is that explained any better?
Technically the way you've explained it means that there is padding on it just because of how you've worded it.

But yeah, JackSparrows solution will work fine. Alternatively, look into a , browsers give elements certain paddings/margins/borders etc and they vary for each browser, so check that out.
 

Users who are viewing this thread

Top