/    Sign up×
Community /Pin to ProfileBookmark

margins and borders in ie/firefox

Hi

I’ve got a page with two divs which I want to appear vertically adjacent, i.e. one directly above the other. In IE it looks fine, but in Firefox a margin is inserted even when I have specified all margins to be 0. The only way I can get the margin to disappear is to put a border around the second div, which I don’t want. Can anyone suggest how I can put this right? Thanks for any help you can offer.

The css is:
DIV#wrapper /*overall container for entire page*/
{
margin-left: auto;
margin-right: auto;
width: 760px;

text-align: left;
font-size: 1em;
}
div#topnavlist
{
margin: 0px 0px 0px 0px;
height: 30px;
BACKGROUND-COLOR: #efefc8;
}
div#innerwrapper
{
BACKGROUND-COLOR: #efefc8;
width: 760px;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}

The html is:

<div id=”wrapper”>

<div id =”topnavlist”>
<p>some content here</p>
</div>
<div id=”innerwrapper”>
<p>some content here</p>
</div>

</div>

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@LJKAug 17.2005 — Hi -

This is what I saw - see attached.

Originally, I was going to suggest that you set width

for the 2nd div, but it looks fine...

El

[upl-file uuid=4a3790ea-2efe-40a5-a5cb-45caed3edb73 size=6kB]test.jpg[/upl-file]
Copy linkTweet thisAlerts:
@ian1234authorAug 18.2005 — Your image shows the same as what I get.

If I remove the height setting from the first div that seems to stop the gap appearing - I don't know if this provides any clues as to where the problem lies. Unfortunately it doesn't solve the problem as I need to specify the height.
×

Success!

Help @ian1234 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...