Forum Moderators: open

Message Too Old, No Replies

Different browsers, different heights?

Seeking info: different browsers, padding? margins?

         

kenhoho

5:05 am on Jun 11, 2003 (gmt 0)

10+ Year Member



Hi, I'm new to these forums.

I'm looking to create a certain code that works cross-browser.

Here's the problem:

(1) My CSS looks like this:

.LINKHOME1 {
margin: 0;
position: absolute;
top: 115px;
left: 235px;
width: 70px;
height: 18px;
background-color: #8B795E;
font-weight: bold;
border-style: solid;
border-color: black;
border-width: 0px 0px 1px 0px;
z-index: 1;
overflow: hidden;
}

(2) My HTML looks like this:

<div class=LINKHOME1>home</div>

(3) For some reason, however, Netscape adds a px of padding below the text that Opera and IE do not. Any ideas why? I would greatly appreciate any assistance.

Thanks.

grahamstewart

5:27 am on Jun 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using a full doctype?
e.g.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

If not then your browser is in 'quirks mode'.
Opera and IE are emulating the old IE box model bug, NN is not.

For maximum cross-browser compatability you should always use a full doctype like the one above (and validate your code [validator.w3.org] to this standard).

See the W3C Valid Doctype list [w3.org] for the correct doctype for your code.

kenhoho

5:36 am on Jun 11, 2003 (gmt 0)

10+ Year Member



Thank you for replying.

Yes, I am using a full doctype, 4.01 transitional, although to be frank I'm not sure whether to use transitional or strict (or even what the difference is).

I have validated my code.

grahamstewart

5:44 am on Jun 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Transitional is intended to make it easier to convert old HTML to the new standards. It continues to support all the old deprecated tags.

Strict is the standard to aim for if your are creating new content in my opinion. It won't let you use any of the deprecated tags and enforces various other standards.

This still sounds like a doctype problem.
Does your doctype include the DTD url (as the one in my example does)? And is it the very first line in your document (e.g. no blank or comment lines before it)?

kenhoho

5:54 am on Jun 11, 2003 (gmt 0)

10+ Year Member



Perhaps you are right -- I will change to strict and see what happens. The doctype line is the very first thing, yes.

Thanks.

kenhoho

5:54 am on Jun 11, 2003 (gmt 0)

10+ Year Member



Oh, and the doctype does contain the url.

kenhoho

6:33 am on Jun 11, 2003 (gmt 0)

10+ Year Member



...unfortunately, changing to strict didn't change anything... for the record here is my top line:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">