-
Hajipur, Bihar, 844101
CSS Color Keywords are predefined color names that browsers recognize. They allow you to apply colors using plain language like red
, blue
, gold
, etc., instead of using HEX, RGB, or HSL values.
CSS supports 140+ standard color keywords.
Color Name | Preview |
---|---|
red |
🔴 Red |
green |
🟢 Green |
blue |
🔵 Blue |
yellow |
🟡 Yellow |
black |
⚫ Black |
white |
⚪ White |
gray |
⚫ Gray |
orange |
🟠 Orange |
purple |
🟣 Purple |
pink |
🌸 Pink |
cyan |
🔷 Cyan |
lime |
🟩 Lime |
gold |
💛 Gold |
navy |
🔵 Navy Blue |
teal |
🟩 Teal |
maroon |
🟥 Maroon |
olive |
🟨 Olive |
silver |
⚪ Silver |
aqua |
🔹 Aqua |
h1 {
color: crimson;
}
div {
background-color: lightgreen;
}
button {
border: 2px solid navy;
}
transparent
and currentColor
transparent
: Makes the element background invisible
currentColor
: Inherits the current color
value
p {
background-color: transparent;
border: 1px solid currentColor;
}
Q1. Set <h2>
text color to blue
.
Q2. Use tomato
color for the background of a paragraph.
Q3. Add a gold
border to a button.
Q4. Make the background of a box transparent
.
Q5. Apply maroon
color to heading text.
Q6. Use currentColor
to match border with text.
Q7. Change a div’s background to lime
.
Q8. Set the text color of a link to navy
.
Q9. Use orange
as the background of a section.
Q10. Create a card with white
text and black
background.
Q1: Which of the following is a valid CSS color keyword?
Q2: What does currentColor do in CSS?
Q3: Which keyword makes the background fully see-through?
Q4: Which is not a valid color keyword?
Q5: Which color keyword will give a light blue background?
Q6: What does the keyword silver represent?
Q7: Which property uses color keywords to style text?
Q8: Which CSS property uses color keywords for backgrounds?
Q9: Which of these is a darker shade keyword?
Q10: Which color keyword gives a dark red tone?