【发布时间】:2014-10-16 16:05:09
【问题描述】:
我正在使用图像制作自定义按钮,然后使用div 将数字对齐到我想要的位置。
此方法适用于除 IE 以外的所有浏览器。文本以按钮为中心,但它浮动到顶部。当我点击按钮时,它完全忽略了按钮的:active,所以所发生的只是.numKeypad:active 正在工作,但按钮没有。
要使其在 IE 中工作,需要进行哪些更改?这是我认为相关的代码部分:
HTML
<div id="btn1" class="btnKeypad" onclick="input(1);">
<div id="num1" class="numKeypad">1</div>
</div>
CSS
#btn1 {
background-image: url(../images/btnUp.png);
cursor:pointer;
left:129px;
top:63px;
}
#btn1:active {
background-image: url(../images/btnDown.png);
left:129px;
top:63px;
}
.numKeypad {
bottom:2px;
font-size:20pt;
position:relative;
text-align:center;
font-family: 'Old Standard TT', serif;
}
.numKeypad:active {
bottom:0px;
font-size:18pt;
position:relative;
text-align:center;
font-family: 'Old Standard TT', serif;
}
【问题讨论】:
标签: html css internet-explorer