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.
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
This site needs an editor - click to learn more!
Editor's Picks Articles
Top Ten Articles
Content copyright © 2019 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.