這些按鈕由span
做出我想要的所有如何讓所有按鈕的高度相同?
同一高度如何獲得呢?在這裏的jsfiddle例如玩http://jsfiddle.net/jitendravyas/Apz9e/16/
/* setting the width and height of the SELECT element to match the replacing graphics */
span.select, select.select {
width:auto ;
height:auto ;
font:3.2em Arial, Helvetica, sans-serif;
font-weight:bold;
padding:7% 7%
}
select.select{
position:relative;
z-index:10;
line-height:1;
}
select option {padding-top:3px; border-bottom:1px solid red}
/* dynamically created SPAN, placed below the SELECT */
span.select{
position:absolute;
bottom:0;
float:left;
left:2px;
line-height:1;
text-indent:10px
background: #ffffff;
background: url('images/color-arrow.png') no-repeat, -moz-linear-gradient(top, #ffffff 0%, #a9a9a9 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#a9a9a9));
background: -webkit-linear-gradient(top, #ffffff 0%,#a9a9a9 100%);
background: linear-gradient(top, #ffffff 0%,#a9a9a9 100%);
cursor:default;
z-index:1;
border:#dadada 1px solid;
border-radius:6px;
background-position: 100% center;
text-shadow:0px 1px 1px #fff; white-space:nowrap;
diaplay:block
}
你的跨度有不同的墊襯,設置填充爲固定值,而不是在課堂上「span.select,select.select」 7%測試「填充:24px的24px的」 –
@RaduMariş - 看到我對薩瓦斯的評論回答 –