【发布时间】:2022-02-12 19:49:27
【问题描述】:
我在使用 css 编辑按钮时遇到问题。
我特别注意到,如果我修改了“取消更改”按钮,则存在于不同 div 中的“删除文章部分”按钮也会被修改。
有人可以帮我吗?
.button[type=submit],[type=button] {
width: 30%;
background-color: rgb(24, 73, 32);
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
button[type=submit]:hover {
background-color: #45a049;
}
<div class = "button">
<button type = "submit" class = "full"> Save changes </button>
<input type = "button" value = "Cancel changes"
onclick = "clearResult (document.getElementById ('id'). value)" />
</div>
<div class = "buttons">
<form action = "creaFrammento.html">
<input type = "submit" value = "Add article part" />
</form>
<input type = "button" value = "Delete article parts" onclick = "confirmation ()" />
</div>
【问题讨论】: