Home arrow HTML arrow Page 4 - HTML Fonts, Styles, and Headers
HTML

HTML Fonts, Styles, and Headers


In our last article we left off our discussion with how to work with images in HTML. In this article we will go over working with fonts, styles, and headers. There is plenty of ground to cover, so let's get to it.

Author Info:
By: James Payne
Rating: 4 stars4 stars4 stars4 stars4 stars / 5
February 27, 2008
TABLE OF CONTENTS:
  1. · HTML Fonts, Styles, and Headers
  2. · How to Set the Font of Text
  3. · How to Set the Color of Your Text
  4. · Styles in HTML/Working with CSS
  5. · Getting Inside Your Head

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials