Click to See Complete Forum and Search --> : Is there anyone to get <p> with the same spacing in both IE and FF?
Lotus9
01-22-2007, 04:38 AM
Hey,
Whenever I try to view a webpage in IE and then FF... there is also some small shifting in the text, I think because the columns widths are slightly different. How do I change this so that cells/columns/rows/tables are the same size in both IE and FF?
Thanks.
Centauri
01-22-2007, 06:38 AM
If the page has a valid doctype, and the font, paragraph, header and div elements have specified margins and paddings, then there will be very little difference. Most problem come about by relying on browser defaults.
Cheers
Graeme
WebJoel
01-22-2007, 08:26 AM
Yes, -what Centauri says. :)
I have taken to starting my <style> with this:
<style type="text/css">
* {border:0; padding:0; margin:0;}/* Set everything to "zero" */
body {height:100%; font-size:1.0em;}/* Assist IE rendering */
h1, h2, h3, h4, h5, h6 {font-family: 'times new roman', arial, verdana, serif;
font-style:normal; font-variant:normal; font-weight:normal; margin-left:16px;}/* indent all, 16px */
h1{font-size: 1.93em;}
h2{font-size: 1.72em;}
h3{font-size: 1.52em;}
h4{font-size: 1.42em;}
h5{font-size: 1.32em;}
h6{font-size: 1.21em;}
</style> With the BOLD part seeming to be quite helpful. It appears that all browsers assume a certain 'default size' for every font-family. Defining a font-size in "body" appears to start them all of with the same measure (I am using "em", so that my text can be 'scalable' but some might prefer "pixels" instead).
I also feel that defining defaults for all <h> tags to be helpful, too.
You can add:
p {line-height:1.1em;}
(for instance), to make the 'line height' of the 'styled font-size' be spaced vertically (the height) the same.