About Lesson
Hexadecimal Colors:
Definition:
Hexadecimal (hex) values represent colors using a combination of six alphanumeric characters. The characters are a combination of numbers (0-9) and letters (A-F), where A represents 10, B is 11, and so on.
Syntax:
HTML
selector {
property: #RRGGBB;
}
Example:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Colors Example</title>
<style>
p {
color: #ff4500;
/* Hex value for orange-red */
}
div {
background-color: #008080;
/* Hex value for teal */
}
</style>
</head>
<body>
<div>
<h1>Hexadecimal Colors</h1>
<p>This are Hexadecimal Colors.</p>
</div>
</body>
</html>
Output: