Color Palette With Variables
CSS
Hard
2 views
Problem Description
Create 3 color variables and use them for background and text.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use CSS variables and apply them.
Official Solution
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>meetcode</title>
<style>
:root { --bg: #0b1220; --text: #f7f7f7; --accent: #0b5; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, Arial, sans-serif; }
a { color: var(--accent); }
.wrap { padding: 18px; }
</style>
</head>
<body>
<div class='wrap'>
<h1>meetcode</h1>
<p>Dark theme preview.</p>
<a href='#'>Start practice</a>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!