Jump to content

Archived

This topic is now archived and is closed to further replies.

Switch0r

Probs with Doctype Declaration

Recommended Posts

When putting the HTML 4.01 Transitional doctype on my page:
[code]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[/code]

all my paragraph tags get an equal height (in font size) gap above and below all elements???

it only causes a problem in firefox and opera, makes no difference either way in IE. taking the doctype out of the page fixes everything in firefox and opera tho...anyone got any ideas?

Cheers :)

Share this post


Link to post
Share on other sites
here is an example to show what i mean

http://www.joncoope.homecall.co.uk/doctype_off.jpg
http://www.joncoope.homecall.co.uk/doctype_on.jpg

the edge of the image is where the edge of the table cell is.

no changes to the page/css made, just adding the doctype

Share this post


Link to post
Share on other sites
This is becuase when you add a doctype the browser goes in to standards mode. Meaning it follows the standards set by W3C with the doctype you are using.

What it appears to be is it adding extra padding in the black box. Could you post a live example of the webpage.

Share this post


Link to post
Share on other sites
not easily, its all on my local server with db gubbins goin on...and ive only got my free isp webspace atm :(

is there anything i can put in my css file to control the margin/line height or something?

http://joncoope.homecall.co.uk/problem.css

this is what i got so far

update: http://joncoope.homecall.co.uk/test.html

any ideas?

Share this post


Link to post
Share on other sites
I need to need to see the HTML in order to make any sense of the CSS. Attach the HTML file here.

What CSS selectors in your style sheet styles your menu?

Share this post


Link to post
Share on other sites
all sorted!

i hadnt thought of the margins on my css :)

whats the default on those anyway?

Share this post


Link to post
Share on other sites
Not sure but each browser has its own defualt margin/padding on block level elements. But I thinks it like 1em or something.

Share this post


Link to post
Share on other sites
Its a another form of unit size. I think 1em is equal to about 14px or 16px.

It is recommended to use em rather pt for sizing text. This [url=http://www.clagnut.com/blog/348/]article[/url] explains why.

Share this post


Link to post
Share on other sites
an em is a [i]relative[/i] unit of size. One em is the [i]width[/i] of the character m using whatever font you're using. Trivia: one en is half of one em.

The Clagnut reference is well worth study and understanding.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.