Attaching Style Sheets

Here it gets a little tricky. The style tag doesn't have a src attribute, so you can't use the style tag to attach an external style sheet. Instead, use the link tag:

<html>
  <head>
    <title>Page Title</title>
    <link href="css/mystyles.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <!-- The content of the page goes here. -->
  </body>
</html>

TIP

Another alternative is to import the external style sheet. See Topic 42 for details.

You'll note a couple things about the link tag here. It doesn't have an src attribute, either, but it does have an href attribute, which works exactly the same way. The path from the current page to the external style sheet goes in there. The rel attribute describes the relation of the linked ...

Get Web Design Garage 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.