XHTML & CSS
text

Font Family

<!-- ~~~~~~~~~~  CODE ~~~~~~~~~ -->

<style type="text/css">
p.serif {font-family: courier;}
p.sansserif {font-family: sans-serif;}
p.mono {font-family: monospace;}
p.cursive {font-family: cursive;}
</style>
................
<p class="serif">This is a paragraph</p>
<p class="sansserif">This is a paragraph</p>
<p class="mono">This is a paragraph</p>
<p class="cursive">This is a paragraph</p>

How it looks in the browser

This is a paragraph

This is a paragraph

This is a paragraph

This is a paragraph



Font Size

<!-- ~~~~~~~~~~  CODE ~~~~~~~~~ -->

<style type="text/css">
 p.em {font-size: 3em;}
p.px {font-size: 15px;}
p.onefifty {font-size: 150%;}
p.small {font-size: small;}
</style>
.............
<p class="em">
This is a paragraph
</p>
<p class="px">
This is a paragraph
</p>
<p class="onefifty">
This is a paragraph
</p>
<p class="small">
This is a paragraph
</p>

How it looks in the browser

This is a paragraph

This is a paragraph

This is a paragraph

This is a paragraph



Font Weight

<!-- ~~~~~~~~~~  CODE ~~~~~~~~~ -->

<style type="text/css">
 p.light {font-weight: light;}
 p.w700 {font-weight: 700;}
 p.bold {font-weight: bold;}
</style>
.............
<p class="light">
This is a paragraph
</p>
<p class="w700">
This is a paragraph
</p>
<p class="bold">
This is a paragraph
</p>

How it looks in the browser

This is a paragraph

This is a paragraph

This is a paragraph



Author - Alan Dunbar
Creative Commons Licence
Valid XHTML 1.0