Jump to content

font sizes


gevans

Recommended Posts

Hey guys,

 

Just a bit of curiosity over here. When I first started making websites i set the font size of the body in pixels;

 

body {font-size: 15px;}

 

Then I got annoyed of having the header elements at their default size so started using the asterix to set all fonts;

 

* {font-size: 15px;}

 

Recently I've started setting my default font in em;

 

* {font-size: 1.0em;}

 

Then all other font size changes are made in percentages;

 

span.this-style {font-size: 88%;}

 

I've been doing this for accessibility, and ease of changing specific font sizes within a page.

 

What are other people doing, what works for you?

Link to comment
https://forums.phpfreaks.com/topic/170970-font-sizes/
Share on other sites

I read in an article that a good way to do it is to set the base size in pixels, then everything else in ems.  I haven't tried it myself yet, but it sounds intriguing.

 

Link to article: http://net.tutsplus.com/tutorials/html-css-techniques/six-ways-to-improve-your-web-typography/

Link to comment
https://forums.phpfreaks.com/topic/170970-font-sizes/#findComment-901762
Share on other sites

Ooo, interesting article.

 

 

I was going to say (and although it doesn't say this, this is probably the reason they do it offset from a base in pixels) that em is the size of M (or maybe m... don't remember), so it depends on the current font/size, so doing everything in em doesn't make sense.

Link to comment
https://forums.phpfreaks.com/topic/170970-font-sizes/#findComment-901764
Share on other sites

For my web projects, I use the following CSS rule:

 

body {
font-size:xx-small;
voice-family:"\"}\"";
voice-family:inherit; 
font-size:x-small
}

 

That is based off of sample code from the book 'Bulletproof Web Design', which dedicates the entire first chapter to font flexibility. This in a nutshell simply sets up a uniform yet flexible base across browsers (including most older ones) and works quite well.

 

For actual font size declarations, I use percentages.

Link to comment
https://forums.phpfreaks.com/topic/170970-font-sizes/#findComment-901864
Share on other sites

Archived

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

×
×
  • Create New...

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.