2010-11-24 85 views
1

Bonkers!標籤CSS讓我瘋狂

爲什麼Label元素不符合一切?
我將所有行高設置爲24px,行內塊。

例如這裏:http://jsfiddle.net/kMtYN/

html { 
    font-size: 16px; 
    font-family:'Lucida Grande', 'Trebuchet MS'; 
} 
.ims-div { 
    height: 24px; 
    background: gray; 
} 
.ims-span { 
    display: inline-block; 
    width: 24px; height: 24px; 
    background: green url('is-check-small-sprite-blue.png') 0 -72px no-repeat; 
} 
.ims-label { 
    display: inline-block; 
    line-height: 24px; 
    margin: 0; padding: 0; border: 0; 
    background: purple; 
    color: white; 
    font-weight: normal; 
} 

<div class="ims-div"> 
    <span class="ims-span"></span> 
    <label class="ims-label">CheckBox 1</label> 
</div> 

回答