Professional Documents
Culture Documents
1.1 Introduction
With CSS, you can control the color, font, the size of text, the spacing
between elements, how elements are positioned and laid out, what background
images or background colors are to be used, different displays for different devices
and screen sizes, and much more!
1.2 Topics/Discussion
1.2.1 HTML CSS Styles
Inline Style : In Inline styling, the CSS rules are directly written inside
the starting tag using the style attribute. The style attribute includes a
2
LEARNING PACKET 5 | Web System and Technologies II
Learning
HTML CSS and ColorsPacket 1
series of CSS property and value pairs. Each ‘ property : value ‘ pair is
separated by a semicolon ( ; ).
Example
Example
Example
HTML colors are specified with predefined color names, or with RGB,
HEX, HSL, RGBA, or HSLA values.
Color Names
Background Color
Text Color
Border Color
Color Values
In HTML, colors can also be specified using RGB values, HEX values,
HSL values, RGBA values, and HSLA values.
The following three <div> elements have their background color set with
RGB, HEX, and HSL values:
6
LEARNING PACKET 5 | Web System and Technologies II
Learning
HTML CSS and ColorsPacket 1
The following two <div> elements have their background color set with
RGBA and HSLA values, which adds an Alpha channel to the color (here
we have 50% transparency):
1.3 References
https://www.w3schools.com/
1.4 Acknowledgment
The images, tables, figures and information contained in this module
were
taken from the references cited above.