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

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 / 11
February 27, 2008
  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

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



<style type="text/css">

h1 {color: red}

h2 {color: yellow; text-align:center}

h3 {color: blue; font-size:70}

p {font-family:impact}




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



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:



<link rel="stylesheet" type="text/css" href="styles.css" >



<h1>She's a maniac, maniac for sure.</h1>

<p>And she's programming like she never programmed before.</p>



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

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


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