travisbrown
Technical User
- Dec 31, 2001
- 1,016
Are there any validation or compatibility issues with double classing things, like class="class1 class2"?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<style type="text/css">
#myDiv p.classA.classB {
background-color: gold;
}
</style>
</head>
<body>
<div id="myDiv">
<p class="classA">Class A only</p>
<p class="classB">Class B only</p>
<p class="classA classB">Class A and Class B</p>
</div>
</body>
</html>
.styleA {
color:red;
}
.styleB {
font-weight:bold;
}
<p class="styleA">This should be red</p>
<p class="styleB">This should be bold</p>
<p class="styleA styleB">This should be both red and bold</p>