Specification
Contents
Previous
Next

6.5 Colors

Note that in HTML 4.01, it is preferred to use CSS to specify colors, but with the Transitional DTD, color attributes and the FONT tag are permitted. See W3C's CSS1 Test Suite to test common CSS functionality. See Ian Hickson's Evil Tests to test CSS etc. more thoroughly.

In the table below, the right two columns should be the same color.

Standard 16 Colors (sequence dates back to EGA graphics, but some names changed) :

Color Name and Value Background Color Using Name Background Color Using Value
Black, #000000    
Navy, #000080    
Green, #008000    
Teal, #008080    
Maroon, #800000    
Purple, #800080    
Olive, #808000    
Silver, #C0C0C0    
Gray, #808080    
Blue, #0000FF    
Lime, #00FF00    
Aqua, #00FFFF    
Red, #FF0000    
Fuchsia, #FF00FF    
Yellow, #FFFF00    
White, #FFFFFF    

Extended Colors

Wikipedia Colors

6.6 Lengths

In the tests below, the widths are all set on the column elements, which allows width to be %MultiLength, which is allowed to be in pixels, percentage, or a relative width. The two right column should appear about the same. The reference column is an attempt to produce a table that looks like I think it should for the test column.

Test DescriptionTest ColumnReference Column
Absolute lengths, cell widths totaling the same width as the table
1 2 3 4 5
1 2 3 4 5
Absolute lengths, cell widths totaling less than the table
1 2 3 4
1 2 3 4
Absolute lengths, cell widths totaling more than the table
1 2 3 4 5 6
1 2 3 4 5
6
Percentage widths, cell widths totaling 100%
1 2
1 2
Percentage widths, cell widths totaling less than 100%
1
1
Percentage widths, cell widths totaling more than 100%
1 2 3
1 2
3
Relative widths, simple test
1* 2* 3*
1* 2* 3*
Relative widths, 0* test
1 2
1 2
Relative widths, * test
1 2
1 2

Valid HTML 4.01!