Select element with multiple classes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multiple CSS Classes Example</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
.card {
width: 200px;
padding: 20px;
border-radius: 10px;
margin: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.primary {
background-color: #e6f3ff;
}
.secondary {
background-color: #fff0e6;
}
.highlighted {
border: 2px solid #ffd700;
}
.card.primary.highlighted {
background-color: #b3d9ff;
}
.card.secondary.highlighted {
background-color: #ffd9b3;
}
.title {
font-weight: bold;
margin-bottom: 10px;
}
.content {
font-size: 14px;
}
.primary .title {
color: #0066cc;
}
.secondary .title {
color: #cc6600;
}
</style>
</head>
<body>
<div class="card primary">
<div class="title">Primary Card</div>
<div class="content">This is a primary card without highlighting.</div>
</div>
<div class="card secondary">
<div class="title">Secondary Card</div>
<div class="content">This is a secondary card without highlighting.</div>
</div>
<div class="card primary highlighted">
<div class="title">Highlighted Primary</div>
<div class="content">This is a highlighted primary card.</div>
</div>
<div class="card secondary highlighted">
<div class="title">Highlighted Secondary</div>
<div class="content">This is a highlighted secondary card.</div>
</div>
</body>
</html>
You can view it live here.
No comments to display
No comments to display