Reputation: 1521
What I am able to do:
HTML:
<div id="test">
HELLO!
<input type="text">
</div>
CSS:
#test {
color:#F00;
}
#test input[type=text] {
background-color:#000;
}
What I'd like to do is the same thing if the #test
has not an ID
but a class:
<div class="test">
...
How should I write the CSS in this case?
Upvotes: 0
Views: 48
Reputation: 8457
Simply replace the #
with a .
(period):
.test {
color:#F00;
}
.test input[type=text] {
background-color:#000;
}
Upvotes: 2