Cascading Style Sheets (CSS) to the Xhtml Document
|
| Style Sheet rules (properties) can be applied to the html element using three methods: Inline/Local, Embed/Internal or Linked/External. These methods can be individually or in a combination of rules in a file. Most Style sheet properties are hyphenated terms font-size |
|
The style rules are placed within each XHTML element. The xhtml element followed by the style attribute, equal sign; within double quotes are the style property(ies) colon value and closed double quotes. Multiple properties are separated by semicolon.
This text is 12pt Red.
Style Format: <p style="color:#ff0000;font-size:12pt">Red Text</p>
|
|
The rules for the class or id are embedded in the head. Use div for block level text or span for a group of words.
.change1{font-family:Lucida Calligraphy; font-size:12pt}
<span class="change1"> Ease of Use</span>
Ease of Use
|
The style sheet rules are placed the HEAD element surrounded by the open and close style tag.
<style type="text/css">
h1 {font-family:Times New Roman, serif}
</style>
|
|
A separate style sheet file is created that is linked to the HTML documents. This master CSS file is saved with the extension .css is stored in the folder. This document contains ONLY the style sheet rules and no xhtml elements |
|
Web Design with XHTML Part II
Prince George's Community College
Doris Cuffey, Instructor |