Building Your Learning Module...
Getting things ready for you!
Find videos you like?
Save to resource drawer for future reference!
Control the color of text content using the color property
Set solid colors, gradients, or images using various background properties
Use built-in color names (140+ available)
redbluegreenSix-digit color codes with # prefix
#FF5733#3498DB#2ECC71Red, Green, Blue values (0-255)
rgb(255, 87, 51)rgb(52, 152, 219)rgb(46, 204, 113)RGB + Alpha channel (0-1 for opacity)
rgba(255, 87, 51, 0.8)rgba(52, 152, 219, 0.5)rgba(46, 204, 113, 0.3)<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div class="container">
<h1>🎨 Text Colors</h1>
<div class="color-box red-text">
<strong>Named Color:</strong> This text is red<br>
<code>color: red;</code>
</div>
<div class="color-box hex-color">
<strong>Hex Color:</strong> This text is blue using hex<br>
<code>color: #3498DB;</code>
</div>
<div class="color-box rgb-color">
<strong>RGB Color:</strong> This text is green using RGB<br>
<code>color: rgb(46, 204, 113);</code>
</div>
<div class="color-box rgba-color">
<strong>RGBA Color:</strong> This text has transparency<br>
<code>color: rgba(231, 76, 60, 0.7);</code>
</div>
</div>
</body>
</html>Loading preview...
background-colorSets a solid background color
background-color: #3498DB;background-imageSets a background image or gradient
background-image: url("image.jpg");background-sizeControls the size of background image
background-size: cover;background-positionPositions the background image
background-position: center;background-repeatControls if/how background repeats
background-repeat: no-repeat;background shorthand to set multiple properties at once:background: #3498DB url("bg.jpg") center/cover no-repeat;<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div class="grid">
<div class="card solid">
<div>
Solid Color
<code>#3498DB</code>
</div>
</div>
<div class="card gradient-1">
<div>
Purple Gradient
<code>linear-gradient</code>
</div>
</div>
<div class="card gradient-2">
<div>
Pink Gradient
<code>linear-gradient</code>
</div>
</div>
<div class="card gradient-3">
<div>
Blue Gradient
<code>linear-gradient</code>
</div>
</div>
<div class="card gradient-4">
<div>
Green Gradient
<code>linear-gradient</code>
</div>
</div>
<div class="card gradient-5">
<div>
Sunset Gradient
<code>linear-gradient</code>
</div>
</div>
</div>
</body>
</html>Loading preview...