element sets the color of the heading using a hex
code. There are two values for the background-color property of the
element, The first provides a fallback color using a hex code and
the second is an HSLA value for browsers that support this method.
Each paragraph is then shown in a different color to represent the
varying levels of acidity or alkalinity, and these are specified using RGB
led margin to decrease
anda property called padding to create
(These
Iso uses @ props
between the paragraph box:
1 gap between the edge of the boxes and the text within them.
properties are covered on pages 313-314.)EXAMPLE
COLOR
259, color
‘text/css”
background-color: silver:
color: white:
padding: 20px:
font-family: Arial, Verdana, sans-serif:}
hi ¢
background-color: #ffFFrt
background-color: hsla(0,100%,100%,0.5);
color: #646454:
padding: inherit:}
Pe
padding: Spx:
margin: Opx:}
p.zero {
background-color: rgb(238,62,128):)
p.one {
background-color: rgb(244,90,139):)
p.two {
background-color: rgb(243,106,152):)
p.three {
background-color: rgb(244,123,166);)
p.four {
background-color: rgb(245,140,178):)
p.five {
background-color: rgb(246,159,192):)
pisix {
background-color: rgb(245,176,204):)
p.seven {
background-color: rgb(0,187,136):)
p.eight {
background-color: rgb(140,202.242);)
p.nine {
background-color: rgb(114,193,240):)EXAMPLE
COLOR
p.ten
background-color: rgb(84.182.237):)
peeleven {
background-color: rgb(48,170,233):}
petwelve {
background-color: rgb(0,160,230):)
p.thirteen ¢
background-color: rgb(a,149,226):)
p.fourteen ¢
background-color: rgb(0,136.221):)
plt Seale
14.0 VERY ALKALINE
13.0¢/p>
12.0¢/ p>
L1.0¢/p>
10.0¢/p>
9.0
8.0
7.0 NEUTRALC/p>
6.06/p>
8.0¢/p>
4.0
3.0
?..0
1.0¢/p>
0.0 VERY ACID
color 260)SUMMARY
COLOR
~ Color not only brings your site to life, but also helps
convey the mood and evokes reactions.
_ There are three ways to specify colors in CSS:
RGB values, hex codes, and color names.
~ Color pickers can help you find the color you want.
_ It is important to ensure that there is enough contrast
between any text and the background color (otherwise
people will not be able to read your content).
~ CSS3 has introduced an extra value for RGB colors to
indicate opacity. It is known as RGBA.
~ CSS3 also allows you to specify colors as HSL values,
with an optional opacity value. It is known as HSLA.