Reputation: 56381
I have like this div, that has no ID
or CLASS
attributes:
<div data-placement="kolp">
blabla
</div>
How can I target that in my CSS ? Maybe some javascript help is needed?
Upvotes: 2
Views: 6180
Reputation: 41895
You can try this:
.container > div {
/* targets your div if it's a direct child of container */
}
.container div {
/* targets any div that is inside container */
}
div[data-placement=kolp] {
/* targets any div with the attribute data-placement=kolp */
}
fiddle here: http://jsfiddle.net/JUP87/
Upvotes: 4
Reputation: 253318
You could use attribute-selectors:
div[data-placement] {
/* selects all div elements with the 'data-placement' attribute */
}
/* or */
div[data-placement="kolp"] {
/* selects all div elements with the 'data-placement' attribute which is equal to 'kolp' */
}
References:
Upvotes: 2