Reputation: 4369
Example
Set for all divs with ids starting obj_
a black background color.
Is this possible just using CSS ?
EDIT
Ups I wrote class name in the title byt I ment Id name..
Upvotes: 13
Views: 9248
Reputation: 228162
Using the CSS3 attribute-starts-with selector:
div[id^="obj_"] {
background: #000
}
This will work in all modern browsers.
Upvotes: 27