
You could even make each letter in a word a distinct color: T Which looks like this in a web browser (notice that I reduced the size of the font, and changed the face to a typewriter-like font face called Courier): TECHNICOLOR Here is an example of the FONT attributes color, size, and face in action: TECHNICOLOR You should stick with these font faces for now. Arial is a safe font face to use, and is very readable which makes it very popular.

The face attribute is trickier you should only use font faces that everybody has on their computers. You notice that adding the size="5" attribute with value 5 made the text larger? Font sizes range from 1 to 6: is large is tiny Which looks like this in a web browser: TECHNICOLOR But if I add a FONT tag to it, and add the attributes color (use bgcolor only in the BODY tag) and size I can change the look of the word: TECHNICOLOR If I do nothing to it, it is just plain black text, size 3. Here's an example from Webmonkey (an excellent HTML tutorial website from Wired magazine). Your browser uses some default font settings: the default face is usually Times and the default size is 3, and the default color is black.īut the FONT tag allows you to override those defaults, and display text in special ways. You know font faces by name: Arial, Courier, Times. Introduction to FontsĪll text on a web page is in a font. What if you wanted control over the colors of specific pieces of text on your page? For that you need to learn about the FONT tag. Not too tough, huh? But these BODY attributes affect all the text on a web page.
CSS COLOR CODES FOR WHITE CODE
The background for the page will be white (the bgcolor attribute, "#ffffff" is the hex code for white), the text (the text value, "#000000", is the hex code for black) will be black, links (the link attribute) will be blue, and visited links (the vlink attribute) will be red. If I add these attributes to the BODY tag, it will look like this: The vlink attribute affects the color of links that have been visited on a web page (the default color for visited links is purple). The link attribute affects the color of the linked text on a page (the default color for links is blue). The text attribute affects the color of regular text (text that is not linked) on a page. There are more attributes we can put in the BODY tag that will affect the color of text and links on a web page. Always preview your choices in a web browser! You don't want to overwhelm people with your color choices, so bright yellow is probably not a good background color. This is a good time to put in a word about color choices. "#ffffff" is the code for white, and you need to always use the "#" and enclose the hex code in quotations (it's a value of an attribute, remember). Click here to see some of the possibilities. There are literally hundreds of possible hex codes you can apply to a background. Here is what it looks like in the BODY tag: Here is what the attribute looks like: bgcolor="#ffffff" The inner has a 3 pixel border with a color of white and a background color of orange.To change the background color, you need to add an attribute and a color value to the opening BODY tag (you never add an attribute to a closing tag!).

The outer has a background color of black. In this example, I've nested a element inside of another one. You can create a white border around an element, however, the element will need to be contained within another element with a non-white background (otherwise you'll have white on white - unreadable to the human eye). You could also place the CSS code into a external style sheet. Here's the same thing, but this time using embedded styles. In this example, I set the background color to black, and the text color to white. Therefore, to display white text you will need to change the background color to a color that contrasts enough with the white text, that the text is readable. Note that most browsers display a background color of white. You could also apply the styles against a tag (for all text within that element) or even the tag (for all text on the page). In the following example, I use the HTML tag along with the style attribute. One way of setting the text color to white is by using inline styles.

You can use these HTML codes for setting the text color, background color, or the border color to white. This page contains HTML code for coloring an element white.
