用于删除提交按钮中的填充(边距?)的CSS

问题描述 投票:0回答:2

我一直在尝试从提交(发送表单)按钮删除填充(边距?)并应用字体,颜色等,但是无法使代码在website form中运行。

input[type=submit] {
  color: red;
  font-family: "Open Sans Condensed";
  font-size: 18pt;
  font-weight: bold;
  background-color: #595959;
  padding: 0;
  border: none;
  border-radius: 0;
}

缺少CSS代码的哪一部分?

html css form-submit submit-button
2个回答
1
投票
.form-actions {
    padding: 19px 20px 20px; // Here is your problem
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #aea790;
    border-top: 1px solid #e5e5e5;
}

填充来自form-action div(按钮容器),而不是输入。


1
投票

这是因为您尝试定位的提交按钮实际上不是input。它只是一个div中的<button>

试试这个目标是正确的元素:

.form-actions {
    color: red;
    font-family: "Open Sans Condensed";
    font-size: 18pt;
    font-weight: bold;
    background-color: #595959;
    padding: 0;
    border: none;
    border-radius: 0;
}
© www.soinside.com 2019 - 2024. All rights reserved.