Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Setting the Font of the Whole Page

In the previous examples we've set the font properties of elements such as <H2 ...> or <A ...>. Setting the properties of the entire page isn't much different... we just set the styles for the <BODY ...> element.

For example, suppose we want the entire page to use a sans-serif font. We put a style like this in the <HEAD> section:

BODY
   {
   font-family:sans-serif;
   }

which gives us the fonts on the page you're reading right now.

A popular reason to set the fonts of the entire page is to make font colors compatible with a background color. In that case we can set all the style properties in the style. For example, the following code sets the background color of the page to black, the font to white, and the font family to sans-serif. It also sets the link color to white and the visited link color to yellow.

this code produces this
<STYLE TYPE="text/css">
<!--
BODY
   {
   color:white;
   background-color:black;
   font-family:sans-serif;
   }
A:link{color:white}
A:visited{color:yellow}
-->
</STYLE>
this page

 
 
  Copyright 1997-2002 Idocs inc. Published under the terms of the Open Content License Design by Interspire