Jump to content

Archived

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

sanfly

CSS Font Size

Recommended Posts

Hi Guys

Using CSS, what is the best type of font size to use (eg: px, em etc) that will display the same font size in both IE and firefox, and also give absolute font sizes (ie: not relative other font sized defined futher up in the stylesheet)

Cheers

Share this post


Link to post
Share on other sites
Hi,

I would use something like font size 12px and font style tahoma with a line height of 140% for my main content of a site.

see below for example style:

[code]
content p {
      font-family: Tahoma;
      font-size : 12px;
      font-weight : normal;
      text-align:justify;
      color : #000000;
      background-color : transparent;
      line-height : 140%;
}
[/code]

I've never had a problem with this in any browsers. As for having different font sizes for different text just give the style another name. like in my example i have got -content p- for paragraph if i wanted a header i would create another style called -content h1- then -h2- and so on. Naming the styles this way will link to the main container called content so if you have a container called sidebar for news you would use -sidebar p- or -sidebar h1- and so on.

If creating links use -content a- and define the style for the link and then use -content a:hover- to define what the text would look like if you hover over the link.

Also to get rid of the underline which is created in prgrams like dreamweaver add -text-decoration: none;- to the style for links.

Hope this helps.

Rick

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.