我的HTML:
<ul class="list-group">
<li class="list-group-item"><span class="glyphicon glyphicon-heart"> </span><a href="beauty-parlour-dharapuram.html">Beauty Parlour</a><span class="badge">24</span></li>
<li class="list-group-item"><span class="glyphicon glyphicon-pencil"> </span><a href="sticker-arts-dharapuram.html">Sticker Arts</a><span class="badge">15</span></li>
<li class="list-group-item"><span class="glyphicon glyphicon-cutlery"> </span><a href="hotel-dharapuram.html">Hotels</a><span class="badge">40</span></li>
</ul>
我想在list-group-item之后添加我自己的类,我试过但它没有用。
答案 0 :(得分:0)
你需要怎么做?用脚本?例如,jQuery代码段为您:
$('.list-group-item').addClass('your-class-here');
结果 -
<ul class="list-group">
<li class="list-group-item your-class-here"><span class="glyphicon glyphicon-heart"> </span><a href="beauty-parlour-dharapuram.html">Beauty Parlour</a><span class="badge">24</span></li>
<li class="list-group-item your-class-here"><span class="glyphicon glyphicon-pencil"> </span><a href="sticker-arts-dharapuram.html">Sticker Arts</a><span class="badge">15</span></li>
<li class="list-group-item your-class-here"><span class="glyphicon glyphicon-cutlery"> </span><a href="hotel-dharapuram.html">Hotels</a><span class="badge">40</span></li>
</ul>