Switch0r Posted August 27, 2006 Share Posted August 27, 2006 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 :) Quote Link to comment Share on other sites More sharing options...
Switch0r Posted August 27, 2006 Author Share Posted August 27, 2006 here is an example to show what i meanhttp://www.joncoope.homecall.co.uk/doctype_off.jpghttp://www.joncoope.homecall.co.uk/doctype_on.jpgthe edge of the image is where the edge of the table cell is.no changes to the page/css made, just adding the doctype Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 27, 2006 Share Posted August 27, 2006 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. Quote Link to comment Share on other sites More sharing options...
Switch0r Posted August 27, 2006 Author Share Posted August 27, 2006 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.cssthis is what i got so farupdate: http://joncoope.homecall.co.uk/test.htmlany ideas? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 27, 2006 Share Posted August 27, 2006 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? Quote Link to comment Share on other sites More sharing options...
Switch0r Posted August 27, 2006 Author Share Posted August 27, 2006 all sorted!i hadnt thought of the margins on my css :)whats the default on those anyway? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 27, 2006 Share Posted August 27, 2006 Not sure but each browser has its own defualt margin/padding on block level elements. But I thinks it like 1em or something. Quote Link to comment Share on other sites More sharing options...
Switch0r Posted August 27, 2006 Author Share Posted August 27, 2006 thats another thing, what exactly is em anyway? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 27, 2006 Share Posted August 27, 2006 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. Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 27, 2006 Share Posted August 27, 2006 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.