Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

In HTML, how do I change the color of the text and background of a web page?

To change the color of the text and background of a web page, you need to include extra attributes within the HTML <body> tag. If the site you are creating contains more than one page, you can specify these attributes for all your pages in a single style sheet. For more information, see What is CSS?

Use the bgcolor attribute to change the background color, as follows:

<body bgcolor="#rrggbb">

The color value is specified with two hexadecimal digits each for red, green, and blue intensities. A value of 00 is darkest and ff is lightest, with intermediate values specifying shades in between. To specify white, for example, use #ffffff. To specify bright blue, use #0000ff. For purple, use #ff00ff. For more information, see What are the RGB values of some common colors? and What are the 216 web browser-safe colors?

You can use other attributes in a similar way to specify the colors used to display text. Use the text attribute for normal text, the link attribute for unvisited links, the vlink attribute for previously visited links, and the alink attribute for active links. (A link becomes active when you click it.) For example, to make all normal text appear white and all links appear red, you would use:

<body text="#ffffff" link="#ff0000" vlink="#ff0000" alink="#ff0000">

You can also change the text color of individual words or sections rather than entire documents by using the <font> tag with the color attribute, for example:

<font color="#000000">

You can use any of the hexadecimal numbers representing colors, as described above. To turn off the color change, use a </font> tag.

Choose your colors carefully so that your text will be easily visible. For example, if you're using a dark background color, you should use light colors for text and links to ensure legibility.

This is document abaa in domain all.
Last modified on July 05, 2011.

I need help with a computing problem

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.



Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

I have a comment for the Knowledge Base

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.