在CSS中隐藏按钮

时间:2018-03-08 12:57:22

标签: css

如何在css中隐藏按钮,更多地阅读按钮文本。

我在网站产品存档页面上有一个添加到购物车按钮。但是当产品缺货时,支票会更改为更多。我想按下文本更改的按钮以阅读更多信息。

3 个答案:

答案 0 :(得分:4)

HTML

<input type="button" value="read more"/>

CSS

input[value="read more"]{ display:none; }

&#13;
&#13;
input[value="read more"]{
display:none;
}
&#13;
<input type="button" value="read more"/>

<input type="button" value="add to cart"/>
&#13;
&#13;
&#13;

答案 1 :(得分:0)

您应该将display: none;添加到按钮样式以隐藏。

答案 2 :(得分:0)

您应该使用一种样式来擦除按钮样式,但是它仍将按钮文本保留在那里。将诸如此类的css类应用于按钮

.icon-button {
   border: none;
   background:none;
}