Monday, November 15, 2010

Free HTML Course: Week 4 - Your First CSS and Special Characters

If you can't see this email, click here

About.com


Week 4 - Your First CSS and Special Characters
Jennifer Kyrnin
From Jennifer Kyrnin, your Guide to Web Design / HTML

Once you start adding text to your Web pages, the first thing most people want to do is change the fonts, and colors on the page. This is CSS rather than XHTML, but it's easy. So, this week the only HTML we'll learn is how to add special characters to your pages. The rest you'll learn will be some basic Cascading Style Sheets so that you can modify your pages fonts and colors.

Note: if you didn't receive the previous weeks you can always pick up missed lessons online at: http://webdesign.about.com/c/ec/9lost.htm You can also get the lessons more quickly if you'd like.

Syllabus
Week 4
  • Attributes - How you'll add styles
  • Fonts - change the face, size, and color with CSS
  • Color - learn to choose colors and add them with CSS
  • Special Characters - add accents and tildes to your text
  • Homework


Attributes
How to Add an Attribute to an HTML Tag

You've already learned the basic tags to manipulate text. But in order to change the fonts and colors, you need to add attributes to your HTML tags.


Your First CSS
Adding Styles Inline

You'll add a style attribute to your HTML tags in order to change the font and the color.

This article recommends that you not use inline styles, but for the purposes of this class, you should. If you want to learn more about CSS after you've mastered HTML, there are many ways you can learn CSS.


Changing Font Attributes

There are several style properties that you can use to change the font size, family, and color. In this page, the style attribute is added to the <span> tag, but you can add these styles to your paragraph or blockquote tags, as well.


Using Color on Web Pages
How to Specify a Color

Colors in CSS are usually defined as numerical constructs, rather than by names. But CSS allows you to use either. There are 16 color keywords in the CSS standard, and over 100 SVG color keywords. But if you still can't find the color you like you can use an RGB code to define exactly the color you want to use. You will also hear a lot about browser safe or Web safe colors. But most people agree that it's no longer critical to use only that limited palette.


How to Change Colors

The most common color attribute to be changed on a Web page is the font color. Luckily this is really easy using the color property in CSS. You can also change the background color of your page by using the background-color property on your <body> tag:

<body style="background-color:red;">


Special Characters
Using Non-English Letters

Before you skip this section saying "I'll never use non-English letters on my Web pages," stop for a second. You may not use non-English characters, but are you ever going to write <? or &? Because these characters are used in HTML, you can't write them alone, you have to use a special character code to have them display on your site.

If you can't find the character you're looking for on the All Letters code sheet, then try the ASCII Codes sub-set. That has characters like the registered mark and copyright symbol.


Homework
Practice What You've Learned

Change at least one aspect of the font on your Web page. This could be the color, size, or font family. Add a background color either to a paragraph or to the entire page. Don't forget to include your copyright notice on the page.

I've put up a page for the homework: http://webdesign.about.com/od/html101classes/l/zhtmlclass4.htm.

Don't forget, if you're having difficulty with the lesson post your questions to the forum.



This email is written by:
Jennifer Kyrnin
Web Design / HTML Guide
Email Me | My Blog | My Forum
 
Missing a lesson? Click here.

About U. is our collection of free online courses designed to help you learn a new skill, solve a problem, get something done, or just learn more about your world. Sign up now, and we will email you lessons on a daily or weekly basis.
You are receiving this email because you subscribed to the About.com 'Free HTML Course' email. If you wish to unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 

Advertisement

No comments:

Post a Comment