HTML and CSS Reference
In-Depth Information
background
-
color
:
hsla(113, 46%, 91%, 1);
}
.
money
{
text
-
align
:
right
;
}
table
{
background
-
color
:
#FFC;
}
.
alt1
{
background
-
color
:
hsla(113, 46%, 91%, .8);
}
</
style
>
<
meta http
-
equiv
=
”Content-Type”
content
=
”text/html; charset=UTF-8”
>
<
title
>
Color Separation
</
title
>
</
head
>
<
body
>
<
table
>
<
caption
>
Sick Thinking Games
,
Inc
.
</
caption
>
<
tr
>
<
th
>
Name
<
th
>
Acct No
.
<
th
>
Amount
<
tr class
=
”alt1”
>
<
td
>
Joe Doaks
<
td
>
ID065212
<
td class
=
”money”
>
$92.83
<
tr
>
<
td
>
Jane Franco
<
td
>
ID034986
<
td class
=
”money”
>
$17.78
<
tr class
=
”alt1”
>
<
td
>
Fernando Rodriguez
<
td
>
ID019921
<
td class
=
”money”
>
$221.83
<
tr
>
<
td
>
Benny Jet
<
td
>
ID073456
<
td class
=
”money”
>
$320.45
</
table
>
</
body
>
</
html
>
118
By default, the
td
element let -justii es text, which is desirable in most cases. However,
with l oating point numbers (numbers with decimal points), numbers are clearer using
right-justii cation. So, one of the style sheet classes included a
money
class to right-justify
i nancial data.
h e entire table is given a light yellow background. However, the background color of the
table doesn't af ect the materials in the
<caption>
container; so the
caption
element gets