我犯了一些錯誤,並需要知道是否能解決這個問題:(選擇元素類依賴於它的其他類
看看這個網站
<style>
.error { width:32px; height:32px; display:inline-block; }
/* This is icon class */
</style>
<div class="error"> this Is error icon 32px * 32px </div>
<div class="error"> this Is error notice 500px * 35px </div>
我怎樣才能使它實現了第一個錯誤上課不影響第二
我這樣做
<style>
.error[class*='icon'] { width:32px; height:32px; display:inline-block; }
/* i was think it should effect the first class only but not ??? */
</style>
<div class="icon error"> this Is error icon 32px * 32px </div>
<div class="notice error"> this Is error notice 500px * 35px </div>
是有我用.error[class*='icon']
謝謝@BoltClock它的工作,可能是我困了,其簡單的答案:) – 2012-03-16 19:57:52