Font-family part 1

CSS Fundamentals
Working with Text
font-size
31
1/2
         

The font-size Property



The font-size property sets the size of a font. One way to set the size of fonts on the web is to use keywords. For example xx-smallsmallmediumlargelarger, etc. 

The HTML:<p class="small">
Paragraph text set to be small
</p>
<p class="medium">
Paragraph text set to be medium
</p>
<p class="large">
Paragraph text set to be large
</p>
<p class="xlarge">
Paragraph text set to be very large
</p>

The CSS:
p.small {
font-size: small;
}
p.medium {
font-size: medium;
}
p.large {
font-size: large;
}
p.xlarge {
font-size: x-large;
}
Try It Yourself

Result:
Keywords are useful if you do not want the user to be able to increase the size of the font because it will adversely affect your site's appearance.

Comments

Popular posts from this blog

font-family part 1