Specificity Without !important
CSS
Hard
3 views
Problem Description
Make a .banner p rule beat a plain p rule without !important.
Output Format
Print the HTML+CSS code in one block.
Constraints
Do not use !important.
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>
p { color: #333; }
.banner p { color: #0b5; font-weight: 600; }
</style>
</head>
<body>
<div class='banner'>
<p>Welcome to meetcode.</p>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!