Cascading Style Sheets

Cascading Style Sheets, or CSS, is an extension of HTML in which the user can redefine the definition of a tag. This form then takes precedence over the default and is used to render the text.

Create the file shown in Listing 11.1 and save it as listing11-1.html.

Listing 11.1 A Simple Example of Using Cascading Style Sheets
 1: <html> 2: <!-- In this file, we define four different interpretations 3: of the SPAN tag using style sheets. The name of the 4: file is listing11-1.html. --> 5: 6: <head> 7: <title>First Style Sheet Example</title> 8: <STYLE TYPE="text/css"> 9: <!-- 10: SPAN.red 11: { 12: color:red; 13: font:14 pt; 14: } 15: SPAN.purple 16: { 17: color:purple; 18: font:16 pt; 19: } 20: SPAN.blue 21: { 22: color:blue; ...

Get Sams Teach Yourself XML in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.