简单的问题:我的JSP页面中有一个这样的按钮
<input type="button" class="MyButton" disabled>
这是CSS样式:
.MyButton{
background-color:#44c767;
border:1px solid #18ab29;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:16px;
font-weight:bold;
padding:15px 21px;
text-decoration:none;
}
.MyButton:hover {
background-color:#5cbf2a;
}
.MyButton:active {
position:relative;
}
我希望我的按钮在设置值时不会改变大小,例如:
<input type="button" class="MyButton" value="1" disabled>
如果我的按钮的尺寸宽度为:10px和高度:10px,我希望继续使用值参数
我怎么能这样做?
答案 0 :(得分:1)
在您的css文件中,尝试:
.MyButton {width: 150px}
或
.MyButton {width: 150px !important;}