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>
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 document, and the type attribute tells what kind of style sheet the linked document is. The last two attributes aren't mission critical, in that all you really need is the href attribute to attach the style sheet, but they can be useful to the software or hardware that reads the Web page, so you should try to include them.
Another thing about the link tag is that it doesn't require a closing version of itself, </link>. The link tag is self-contained, while the script tag isn't. That means, when you open a script tag, always try to close it, even if you don't have any embedded JavaScript between the tags. But with a link tag, you don't have to go to the trouble. |