使用CSS:我如何定位第一類「方法」,第二類和第三類。所有人都是因爲他們需要不同的風格我無法添加額外的課程以避免響應性迷失方向。CSS選擇:nth-of-class()替代方案
HTML代碼:
<div class="approaches">
<div class="col-md-4">
<a href="#" class="approach">content here...</a>
</div>
<div class="col-md-4">
<a href="#" class="approach">content here...</a>
</div>
<div class="col-md-4">
<a href="#" class="approach">content here...</a>
</div>
</div>
CSS代碼(不目前工作):
.approaches .approach:nth-of-type(1){
color: red;
}
.approaches .approach:nth-of-type(2){
color: green;
}
.approaches .approach:nth-of-type(3){
color: blue;
}
你能把class =「approach」提升到div的水平嗎? – kornieff 2014-09-13 08:22:27