html - 如何使 Button 在 JSP 页面中无法调整大小

标签 html css jsp button web-applications

简单的问题:我的 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/

相关文章:

html - 为什么 tabindex ='-1' 会阻止键盘

html - 修复文档类型声明后,我的页面崩溃了

javascript - 我的立方体消失了,我不知道为什么

java - 在 Struts 2 中使用 ModelDriven

jsp - Tomcat 吞下 SQLException

html - flex 订单属性未按预期工作

html - 打印页面中的页眉和页脚?不是 Web 浏览器页眉和页脚

javascript - 删除滑动切换效果

html - 当元素为空时如何删除上边距?

java - 使用jsp-servlet从数据库中检索多个图像