O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Stylesheets in XHTML

You can use stylesheets in several ways in XHTML. As we already saw in this chapter, you can use the <link> element to connect an external stylesheet to a document, like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/tr/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>
            Working With External Style Sheets
        </title>
        <link rel="stylesheet" href="style.css">
    </head>

    <body>
       <center>
           <h1>
               Working With External Style Sheets
           </h1>
           <p>
           This document is displayed using an external style sheet.
           </p>
       </center>
    </body>
</html>

This XHTML links the Web page to an external stylesheet named style.css, written in CSS (refer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required