CSS在标签中添加多个class属性
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Challenge: A classy gallery</title>
<style>
body {
font-family: cursive;
}
.image-small {
width: 150px;
}
.image-medium {
width: 200px;
}
.black-frame {
border: 8px double rgb(38, 38, 38);
}
.gold-frame {
border: 10px ridge rgb(255, 183, 0);
}
.silver-frame {
border: 10px groove rgb(204, 204, 204);
}
</style>
</head>
<body>
<h1>A classy gallery</h1>
<img src="https://www.kasandbox.org/programming-images/animals/cat.png" class="image-small silver-frame">
<img src="https://www.kasandbox.org/programming-images/animals/fox.png" class="black-frame image-small">
<img src="https://www.kasandbox.org/programming-images/animals/penguins.png" class="silver-frame image-medium">
</body>
</html>
不同的class属性用空格间隔