Not Selector
CSS
Medium
3 views
Problem Description
Make all buttons green except the one with class 'danger'.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use :not(.danger).
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>
button:not(.danger) { background: #0b5; color: #fff; border: 0; padding: 10px 14px; border-radius: 10px; }
.danger { background: #c1121f; color: #fff; border: 0; padding: 10px 14px; border-radius: 10px; }
</style>
</head>
<body>
<button type='button'>Save</button>
<button class='danger' type='button'>Delete</button>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!