CSS Values
CSS (Cascading Style Sheets) is a language used to style a web page. CSS values are used to define the visual appearance of HTML elements on a web page. Here are some of the most commonly used CSS values:
1. Color Values
Color values are used to set the color of an HTML element.
There are several ways to specify color values in CSS, including:
- Hexadecimal values:
#RRGGBB
or#RGB
- RGB values:
rgb(red, green, blue)
- RGBA values:
rgba(red, green, blue, alpha)
- HSL values:
hsl(hue, saturation, lightness)
- HSLA values:
hsla(hue, saturation, lightness, alpha)
- Named colors:
red
,blue
,green
, etc.
2. Length Values
Length values are used to set the size of an HTML element.
There are several ways to specify length values in CSS, including:
- Pixels:
px
- Em units:
em
- Rem units:
rem
- Percentages:
%
3. Font Values
Font values are used to set the font of an HTML element.There are several ways to specify font values in CSS, including:
- Font family:
font-family
- Font size:
font-size
- Font style:
font-style
- Font weight:
font-weight
4. Border Values
Border values are used to set the border of an HTML element.There are several ways to specify border values in CSS, including:
- Border width:
border-width
- Border style:
border-style
- Border color:
border-color
5. Background Values
Background values are used to set the background of an HTML element.There are several ways to specify background values in CSS, including:
- Background color:
background-color
- Background image:
background-image
- Background position:
background-position
- Background repeat:
background-repeat