2012-01-15 21 views
0

我有一個div,看起來像這樣無法針點這個選擇

<div class="listItem jrFeatured"> 

我希望它保留listItem所有的CSS,但有額外的CSS爲jrFeatured

但我不希望所有jrFeatured是不同的只有在listItem

這是我真的誤解或有辦法實現我想要的嗎?

回答

4
.listItem { 
    /* code for item(s) matching listItem class */ 
} 

.jrFeatured { 
    /* code for item(s) matching jrFeatured class */ 
} 

.listItem.jrFeatured { 
    /* code for item(s) matching BOTH listItem and jrFeatured classes */ 
    /* based on your question, this sounds like what you're looking for */ 
} 
+0

完美的作品謝謝你!一個+++++++ – Rob 2012-01-15 17:33:29