HTML and CSS Reference
In-Depth Information
Given all the possibility of error, Web page authors should think twice before employing ad
hoc color names, though those in Table C-2 are safe in practice.
(X)HTML Elements Supporting Color
Presentation directives should be moved to CSS, but in the case of older and transitional
variants of (X)HTML, a number of elements support color values using either six-digit hex
color values or names. Table C-3 summarizes these elements. For more information on these
elements and their usage, see the element reference in Chapter 3.
(X)HTML Element Example
Notes
Transitional syntax
basefont
<basefont color= "red " size= "+2 ">
body
<body bgcolor="white" text="black"
alink="red" link="blue"
vlink="purple">
Transitional syntax
col
<col bgcolor="orange">
Internet Explorer
syntax
colgroup
<colgroup bgcolor="yellow">
Internet Explorer
syntax
font
<font color="red" size="7"> Big Red!
</font>
Transitional syntax
frame
<frame bordercolor="red"
src="red5.html">
Internet Explorer
syntax
frameset
<frameset bordercolor="red">
Internet Explorer
syntax
hr
<hr color="red" size="5">
Internet Explorer
syntax
iframe
<iframe src="portlet.php"
bordercolor="red" height="200"
width="200"></iframe>
Internet Explorer
syntax
Netscape 4 syntax
ilayer
<ilayer name="ilayer1" bgcolor="green">
<p> Layered information goes here. </p>
</ilayer>
layer
<layer name="layer1"
bgcolor="#00FFFF">
<!-- layer content here-->
</layer>
Netscape 4 syntax
marquee
<marquee bgcolor="red"> Stocks surge!
</marquee>
Internet Explorer
syntax
table
<table bgcolor="yellow" border="1"
bordercolor="blue" bordercolorlight=
"orange" bordercolordark="red">
Border color attributes
are Internet Explorer-
introduced syntax
T ABLE C-3 (X)HTML Elements Supporting Color Values
 
Search WWH ::




Custom Search