Css Color Use Module
Css Color Use Module
Learning Objectives
At the end of this lesson, you will be able to understand the different
CSS measurement units, use comments to explain codes and identify
the different color values to specify a color.
CSS COLORS 2
CSS UNITS
One of the things you will use every day in CSS are units. They are
used to set lengths, paddings, margins, align elements and so on.
Pixels
The most widely used
measurement unit.
01/30/2023 https://www.w3schools.com/cssref/css_units.php 5
Relative Lengths
Relative length units specify a length relative to another length
property. Relative length units scale better between Adifferent
browser’s default
font-size is 16px.
rendering medium.
01/30/2023 https://www.w3schools.com/cssref/css_units.php 6
CSS COMMENTS
Comments are used to explain the code and may help when you edit
the source code at a later date. Comments are ignored by browsers.
A CSS comment is placed inside the <style> element, and starts with /*
and ends with */:
Example
p { color: red; }
01/30/2023 PRESENTATION TITLE 7
Pre-Test: Identify the Hexadecimal Code of the given CSS
Colors. Choose your answer on the box.
#FFFF00
#FF0000 #00FF00
#00FF00
#FFA500
#FFFF00 #0000FF
#FF0000
#FFA500 #0000FF
•CSS uses color values to specify a color. Typically, these are used to
set a color either for the foreground of an element or else for the
background of the element. They can also be used to affect the color
of borders and other decorative effects.