简单的问题:我的 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,我希望它继续使用 value 参数保持该尺寸
我该怎么做?
最佳答案
在你的 css 文件中,尝试:
.MyButton {width: 150px}
或
.MyButton {width: 150px !important;}
关于html - 如何使 Button 在 JSP 页面中无法调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34617844/