开发者

Is it possible to set css properties by id prefix?

Example

Set for all divs with ids starting obj_ a black background color.

I开发者_StackOverflow社区s this possible just using CSS ?

EDIT

Ups I wrote class name in the title byt I ment Id name..


Using the CSS3 attribute-starts-with selector:

div[id^="obj_"] {
    background: #000
}

This will work in all modern browsers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜