/    Sign up×
Community /Pin to ProfileBookmark

padding problem

On this [URL=http://www.lighthousemuseum.org.uk/indexDIV.html]page[/URL]

when viewed in IE looks right.

However when viewed in FF and Netscape it is not in line with the picture above.

Here is the CSS.

[CODE]#mainimage{
width: 540px;
height: 240px;
position:absolute;
top:110px;
left:0px;
}

#content{

width: 540px;
height: 370px;
position:absolute;
top:350px;
left:0px;
background-color: #ffffff;
text-align:justify;
padding-top: 0px;
padding-left: 40px;
padding-right: 40px;
padding-bottom: 40px;
}
[/CODE]

As you can see both widths are the same. It appears that FF and Netscape are adding the left and right padding to the width. Would this be correct?

I really want to use css/divs for layouts rather than tables. Is there a simple workaround for this?

J

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzOct 14.2005 — http://www.tjkdesign.com/articles/boxmodel.asp

[url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp]Difference between box models, doctype switching, etc.[/url]

[url=http://www.communitymx.com/content/article.cfm?cid=E0989953B6F20B41]The Box Model Problem[/url]

http://www.hut.fi/u/hsivonen/doctype

http://www.alistapart.com/articles/doctype/

http://www.juicystudio.com/choosing-doctype/

http://www.w3.org/QA/2002/04/valid-dtd-list.html

I advocate using HTML 4.01 (preferably Strict, though currently I mostly use Transitional, though I may change that soon). Converting valid HTML 4.01 written in lowercase and with ends tags even for elements that have optional end tags to XHTML 1.x only requires a few regular expressions or HTML Tidy.
Copy linkTweet thisAlerts:
@tegraphixOct 14.2005 — It's a padding issue, IE handles padding different than those other browsers. Read the box model links provided by Kravvitz and see what they say about IE and padding.
×

Success!

Help @john_noble 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.8,
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,
)...