Dan*_*ett 26 css css-selectors css3
在CSS中,如何选择<tr>其id开头section_和结尾的所有元素_dummy?
例如,我想选择并应用以下<tr>的样式:
<tr id="section_5_1_dummy">
    <td>...</td>
</tr>
<tr id="section_5_2_dummy">
    <td>...</td>
</tr>
Dan*_*ett 62
以下CSS3选择器将完成这项工作:
tr[id^="section_"][id$="_dummy"] {
    height: 200px;
}
该^表示什么id应该开始.
该$表示什么id应该结束.
id本身可以替换为另一个属性,例如href,当应用于(例如)时<a>:
a[href^="http://www.example.com/product_"][href$="/about"] {
    background-color: red;
}
| 归档时间: | 
 | 
| 查看次数: | 17594 次 | 
| 最近记录: |