【发布时间】:2019-09-18 13:16:54
【问题描述】:
我有一个包含多个按钮的页面。我想使用 css 更改其中一个,但似乎无法弄清楚如何在 CSS 中执行此操作,而不更改所有这些。
<p>
<button data-toggle="collapse" data-target="#acne" class="collapsed">Acne</button>
</p>
<div id="acne" class="collapse">
<ul>
<li>Blackheads</li>
<li>Whiteheads</li>
<li>Pimples</li>
<li>Nodules or cysts</li>
<li>Redness or flushing</li>
</ul>
</div>
<p>
<button data-toggle="collapse" data-target="#backpain">Back Pain</button>
</p>
<div id="backpain" class="collapse">
<ul>
<li>Pain in the lower back</li>
<li>Pain, numbness, or tingling on one side of the buttocks or leg</li>
<li>Weakness of the muscles in one leg</li>
</ul>
</div>
我希望 Acne 按钮的颜色和大小不同。任何帮助将不胜感激。
【问题讨论】:
-
你可以给你想要的样式添加一个类属性吗?你能编辑 HTML 吗?
-
将
id="uniquebutton"添加到包含“Acne”的 div 中,然后将#uniquebutton{height: (bigger than other button; width: (bigger than other button); background: (different color than other button}添加到您的 CSS 中。显然,将(大于其他按钮)的值更改为您选择的值。颜色也一样。