Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Color
IN A ROCKET
Learn front-end development at rocket speed
NAMED COLORS
The color property sets the foreground color of an element's text content, and its decorations.
p { color: green }
With this code all paragraphs are shown in green.
RGB/RGBA HSL/HSLA
COLORS COLORS
HTML CSS
<body> p { color: red; }
<p>CSS rocks!</p>
</body>
Browser
Web page title
index.html
CSS rocks!
RGB/RGBA HSL/HSLA
COLORS COLORS
p { color: #000000 }
#
9 9 9
8 8 8
7 7 7
6 6 6
5 5 5
4 4 4
3 3 3
2 2 2
1 1 1
0 0 0
#
9 9 9
8
7
6
8
7
6
8
7
6
= #ff0000
5 5 5
4 4 4
3 3 3
2 2 2
1 1 1
0 0 0
#
9 9 9
8
7
6
8
7
6
8
7
6
= #00ff00
5 5 5
4 4 4
3 3 3
2 2 2
1 1 1
0 0 0
#
9 9 9
8
7
6
8
7
6
8
7
6
= #0000ff
5 5 5
4 4 4
3 3 3
2 2 2
1 1 1
0 0 0
#000000 #ff0000
#000 #f00
#ffffff #00ff00
#fff #0f0
#0000ff
#00f
HTML CSS
<body> p { color: #f00; }
<p>CSS rocks!</p>
</body>
Browser
Web page title
index.html
CSS rocks!
RGB/RGBA HSL/HSLA
COLORS COLORS
0 0 0
rgb(0,0,0) rgb(255,0,0)
rgb(255,255,255) rgb(0,255,0)
rgb(0,0,255)
HTML CSS
<body> p { color: rgb(0,0,255) }
<p>CSS rocks!</p>
</body>
Browser
Web page title
index.html
CSS rocks!
Alpha
(transparency)
p { color: rgba(0,0,255,0.5) }
1
With this code all paragraphs are shown in blue with 50% transparency.
HTML CSS
<body> p { color: rgba(0,0,255,0.5) }
<p>CSS rocks!</p>
</body>
Browser
Web page title
index.html
CSS rocks!
RGB/RGBA HSL/HSLA
COLORS COLORS
p { color: hsl(240,100%,50%) }
0 360
hsl(0,0%,0%) hsl(0,100%,50%)
hsl(0,0%,100%) hsl(120,100%,50%)
hsl(240,100%,50%)
HTML CSS
<body> p { color: hsl(240,100%,50%) }
<p>CSS rocks!</p>
</body>
Browser
Web page title
index.html
CSS rocks!
Alpha
(transparency)
p { color: hsla(240,100%,50%,0.5) }
1
0
With this code all paragraphs are shown in blue with 50% transparency.
HTML CSS
<body> p { color: hsla(240,100%,50%,0.5) }
<p>CSS rocks!</p>
</body>
Browser
Web page title
index.html
CSS rocks!
TOOLS
~~~
TOOLS: CSS PEEPER
inarocket .com
Learn front-end development at rocket speed
+ READY TO USE CODE
+ QUIZZES
+ FREE UPDATES
by miguelsanchez.com
inarocket .com
Learn front-end development at rocket speed
Color
IN A ROCKET
Learn front-end development at rocket speed