【发布时间】:2017-11-06 02:15:04
【问题描述】:
我希望在单击按钮后显示一个刻度并降低其不透明度。
#btnTicketType{
margin-bottom:2%;
margin-top:10%;
width:95%;
height:15em;
font-size:1.5em;
}
#seatnumber{
display:block;
width:100%;
text-align:center;
font-size:1em;
}
#rectangle{
height:100%;
width:100%;
overflow:auto;
outline-color:black;
outline-style:solid;
}
<div id="rectangle">
<div class="col-md-3">
<button id="btnTicketType" class="btn btn-default">Button 1</button>
<small id="seatnumber">Text 1</small>
</div>
<div class="col-md-3">
<button id="btnTicketType" class="btn btn-default">Button 2</button>
<small id="seatnumber">Text 2</small>
</div>
<div class="col-md-3">
<button id="btnTicketType" class="btn btn-default">Button 3</button>
<small id="seatnumber">Text 3</small>
</div>
}
</div>
<br />
如果勾号显示后还可以降低按钮的不透明度,这样对用户来说勾号会更加突出。
【问题讨论】:
-
除了
<button></button>或<input type='button' />,您应该使用元素,因为按钮不支持.innerHTML。要么在按钮上使用position:absolute;,然后打勾并拥有两者的父级position:relative;。 -
@PHPglue 这个问题和
innerHTML()有什么关系?<button>标记可以包含其他元素,例如 Op 之后的刻度。从语义上讲,<button>元素比<span>(或您可能推荐的任何元素)更合适。 -
您想在按钮上打勾。您不能在按钮中添加任何内容。
-
嗯,谢谢chiru。我会查看链接,看看我能做什么
标签: javascript jquery html css