More properties

The table below shows the some more important properties which can be used in CSS.

Table 2.2: More CSS properties
Property Syntax Description/possible values
size 20% size = 20%
20px 20 pixel
2em 2*font-size
2mm, 2cm, 2in 2 mm, cm and inch
Color names red, blue, green
hex code (#RRGGBB or #RGB) #FFF000 or #FFF
rgb(num, num, num) rgb(0, 0, 255) or rgb(20%, 10%, 70%)
rgba(num, num, num, percent/decimal) rgba(0, 0, 255, 0.1) or rgb(20%, 10%, 70%, 10%)
Link a:link a:link {color: red}
a:hover
a:visited
a:active
Fonts font-family serif, cursive, monospace
font-style normal, italic, oblique
font-variant normal, small-caps
font-weight normal, bold, bolder, lighter, 100-900
font-size 10px, small, medium, large etc.
Text color red, #FFF
letter-spacing 10px
word-spacing 10px
text-align right, left, center
text-decoration underline, overline, line-through, none
text-transform capitalize, uppercase, lowercase, none
white-space pre, normal, nowrap
text-shadow text-shadow:5px 5px 8px red;
Image border ‘1px’, or ‘1px solid blue’
height, width 100px, 20%
Border border-style solid, dashed, dotted, double, none etc.
border-top-style
border-bottom-style
border-left-style
border-right-style
border-width 4px, 4pt
border-bottom-width similarly use ‘top’, ‘left’, ‘right’
border (shortcut) 1px solid blue’
Margin margin, margin-left etc
Padding padding (top, bottom, left, right) ‘10px 10px 2px 2px’ or ‘10px 2px’
padding-right, padding-left etc.

© Copyright 2025 | FolkLight Studios