HTML Fonts, Styles, and Headers - Styles in HTML/Working with CSS
(Page 4 of 5 )
While CSS is too large of a subject to adequately cover here, I would like to show you a few examples of how it works. For those of you who are unfamiliar with CSS, it stands for Cascading Style Sheets, and allows you to control the style of all the pages (or just one if you like) on your website with a single page.
Formatting <H> tags and <P> Tags
<html>
<head>
<style type="text/css">
h1 {color: red}
h2 {color: yellow; text-align:center}
h3 {color: blue; font-size:70}
p {font-family:impact}
</style>
</head>
<body>
<h1>Peter Piper Picked a peck of Peppers</h1>
<h2>Little Miss Muffet Sat on a Tuffet, eating her curds and whey</h2>
<h3>I'm on writer's strike. Write your own limerick.</h3>
<p>Gorilla. That is all.</p>
</body>
</html>
In the above example we created the CSS inside of our page. You should only do this if there is only one page whose elements you wish to control with CSS.
Referencing an Outside Style Sheet
Style sheets are stored on the server, and you must call them within your HTML page to apply them. You do so with href, like so:
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles.css" >
</head>
<body>
<h1>She's a maniac, maniac for sure.</h1>
<p>And she's programming like she never programmed before.</p>
</body>
</html>
For more information on CSS, you can view my series on the subject. It's well worth the read. I would venture to say its the best CSS tutorial in the galaxy, far better than that punk writer on Omegas Prime.
Next: Getting Inside Your Head >>
More HTML Articles
More By James Payne