The HTML Font Tag - 2

The HTML Font Tag - 2
The last attribute we will talk about is the color attribute. HTML handles colors with 6-digit (hexadecimal) codes. In the example, I have use the color code "#c00000" to make the text red. You can change the color of the text by changing the value of the color attribute on the right side of the equal sign. For more about color and the computer read How The Computer Sees Color.

You are probably asking yourself why you would use the color attribute and the font tag to set the text color when you have already set the text color in the body tag. You learned how to use the body in a previous tutorial. Say you want a word(s) on the page to be a different color from the color you have specified in the body tag. In this way they will stand out on the webpage. This is one example of when you would use the color attribute and the font tag. You would place the special words between the opening and closing font tags. The font tag will override your previous color choice (in the body tag) for only those words between the opening and closing font tags.

<font color="#00c000">Special Words</font>


Now let's put into practice what we have talked about. Open your source code for Template4.html into your text editor. Add the words "Enter Here" under the "Hello World" (the Hello World that is in the body of the webpage and not the <title>). Let's also set the face attribute to Arial, the size attribute to 5 and make these words orange in color (# f76a03). The code for these changes is in the box below. Now save these changes and name your new file Template5.html.

Template5.html - source code
<html>
<head>
<title>Hello World</title>
<meta name="keywords" content="quilts,quilting,
quilt fabrics,quilt patterns,quilt batting,
quilting books,applique,picture quilts,quilt blocks">
<meta name="description" content="Quilting site for
quilters of all types. Resources for supplies, lessons,
information and help, friendship and discussion.">
</head>
<body>
Hello World
<font face="Arial" size="5" color="#f76a03">Enter
Here</font>
</body>
</html>
Note--The arrow indicates that the code is wrapped to a second line and should really be all on one line.

← Back

|




This site needs an editor - click to learn more!



RSS
Editor's Picks Articles
Top Ten Articles
Previous Features
Site Map





Content copyright © 2023 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.