jimmyshoes
Programmer
Is it ok to apply multiple styles to a div. For example
Will behaviour be consistent across all browsers?
Code:
<div class="style1 style2">
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.
<div class="style1 style2">
.style1.style2 {
color: red;
}
.left { float: left; }
.right { float: right; }
.column { width: 365px; }
<div class="column left">
.important{font-size:12px; color:#c00; font-weight:bold}
.quiteImportant{font-size:12px; color:#c00;}
.quiteImportant{font-size:12px; color:#c00;}
.quiteImportant .important{font-weight:bold;}
and then...
<div class="quiteimportant"><div class="important">Text</div></div>
.important {
font-size: 12px;
color: #CC0000;
font-weight:bold;
}
.quiteImportant {
font-size: 12px;
color: #CC0000;
}
.important,
.quiteImportant {
font-size: 12px;
color: #CC0000;
}
.important {
font-weight:bold;
}
.important {
font-size: 12px;
color: #CC0000;
}
.quite {
font-weight:bold;
}
<div class="important"> some text</div>
<div class="quite important"> some other text</div>