Jump to content


Photo

Probs with Doctype Declaration


  • Please log in to reply
9 replies to this topic

#1 Switch0r

Switch0r
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts
  • LocationManchester, UK

Posted 27 August 2006 - 10:05 AM

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

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 :)
The Human Torch was denied a bank loan...

#2 Switch0r

Switch0r
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts
  • LocationManchester, UK

Posted 27 August 2006 - 12:18 PM

here is an example to show what i mean

http://www.joncoope....doctype_off.jpg
http://www.joncoope..../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
The Human Torch was denied a bank loan...

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 August 2006 - 12:29 PM

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.

#4 Switch0r

Switch0r
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts
  • LocationManchester, UK

Posted 27 August 2006 - 12:47 PM

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.home....uk/problem.css

this is what i got so far

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

any ideas?
The Human Torch was denied a bank loan...

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 August 2006 - 12:51 PM

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?

#6 Switch0r

Switch0r
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts
  • LocationManchester, UK

Posted 27 August 2006 - 01:29 PM

all sorted!

i hadnt thought of the margins on my css :)

whats the default on those anyway?
The Human Torch was denied a bank loan...

#7 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 August 2006 - 01:36 PM

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

#8 Switch0r

Switch0r
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts
  • LocationManchester, UK

Posted 27 August 2006 - 02:34 PM

thats another thing, what exactly is em anyway?
The Human Torch was denied a bank loan...

#9 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 August 2006 - 02:39 PM

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 article explains why.

#10 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 27 August 2006 - 03:03 PM

an em is a relative unit of size. One em is the width 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.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users