Home
CSS
CSS Color Keywords
Tryit: Using the currentcolor keyword
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> body { color: purple; } div { background-color: currentcolor; padding: 15px; } div p { color: white; } </style> </head> <body> <h2>The currentcolor Keyword</h2> <p>This is some text in the body part...</p> <div> <p>This div's background color is set to the current color value of the body element.</p> </div> </body> </html>