首页 > 解决方案 > 对除特定 ID 之外的所有按钮应用 CSS

问题描述

我有一个代码:

button {
  background: rgb(1, 81, 227);
  background: linear-gradient(
    90deg,
    rgba(1, 81, 227, 1) 35%,
    rgba(0, 90, 255, 1) 100%
  );
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 20px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 6px;
}

还有一大堆按钮。我想为除两个按钮之外的所有按钮应用该 css 代码,ID 为 startAction 和 endAction。

我怎么做?

标签: css

解决方案


button:not(#startAction):not(#endAction)

通过@underscore_d


推荐阅读