introduction
- Introduction to CSS
- How and where to write CSS?
- CSS Selectors
- Size and Other Units of Measurement
- CSS colors
- Other uses of colour
Formatting Text
Box Model
Advanced selectors
More about CSS
Background color
It is used to set the background color of text or division, etc.
Syntax:
h1 {
background-color:color_name;
}
Example:
<html>
<head>
<title>CSS background color property</title>
<style>
h1 {
background-color:blue;
text-align:center;
}
</style>
</head>
<body>
<h1>
Edupoly Training and Development
</h1>
</body>
</html>
Output:
Border color
It is used to set the border color of an element. Border-style is used to set the border type.
Syntax:
h1 {
border-style:solid/dashed/dotted;
border-color:color_name;
}
Example:
<html>
<head>
<title>CSS border color</title>
<style>
h1 {
border-style:solid;
border-color:blue;
text-align:center;
}
</style>
</head>
<body>
<h1>
Edupoly Training and Development
</h1>
</body>
</html>
Output: