ARCHIVED - CSS - Frequently asked questions
This information has been archived because it is outdated and no longer relevant.
Archived Content
Information identified as archived on the Web is for reference, research or recordkeeping purposes. It has not been altered or updated after the date of archiving. Web pages that are archived on the Web are not subject to the Government of Canada Web Standards. As per the Communications Policy of the Government of Canada, you can request alternate formats by contacting us.
Table of Contents
1.0 How do I use CSS classes?
- Place the classes you need in a CSS file as shown below:
.grayBG{background-color: #CCCCCC;}
.red{color: #CC0000;} - Call the class using the class attribute in an element, as shown below:
<p class="red">This text is red.</p>
2.0 What units should I use?
The % and em units should be used whenever possible. The px unit can be used for border, padding and margin CSS properties.