css 3

Icon

A comprehensive CSS 3 reference guide, tutorial, and blog
Are you a CSS expert? Want to contribute? Contact us

CSS FONT-SIZE

You can manipulate the size of your fonts by using values, percentages, or key terms. Using values are useful if you do not want the user to be able to increase the size of the font because your site will look incorrect if they did so. Percentages are great when you want to change the default font, but do not want to set a static value

 

Example

body {font-size: x-large}
p {font-size: 10px}   

 

Possible Values

Value Description
xx-small 

x-small

small

medium

large

x-large

xx-large

Sets the size of the font to different sizes, from xx-small to xx-large
smaller Sets the font-size to a smaller size than the parent element
larger Sets the font-size to a larger size than the parent element
length Sets the font-size to a fixed size
% Sets the font-size to a % of  the parent element

  
 
 

One Response

  1. Ben in Seattle says:

    I have issue with the sentence, “Using values are useful if you do not want the user to be able to increase the size of the font because your site will look incorrect if they did so.” While technically true, it neglects the more important aspect that fixed value fonts are discouraged in good web design. Browsers are constantly changing as are fonts and screen resolutions. For example, no matter how hard a designer tries, a site she designed on her desktop PC is not going to look the same on the latest handheld computer or wall-sized home media center. Preventing the user from changing the font size is shortsighted and usually ends up seriously damaging the usability of a website, if not breaking it completely.

Leave a Reply

Pages

Sponsors

$100 PSD to XHTML. CONTACT US FOR MORE INFORMATION


CSS3.com



Please help CSS3.com stay alive and running

Bad Behavior has blocked 974 access attempts in the last 7 days.