如何将<ul>
水平居中?
我有带下划线的列表,但它似乎与左侧对齐,我想将其居中。
<ul id="give-donation-level-button-wrap" class="give-donation-levels-wrap give-list-inline">
<li><button type="button" data-price-id="1" class=" give-donation-level-btn give-btn give-btn-level-1 give-default-level" value="25.00">$25</button></li>
<li><button type="button" data-price-id="2" class=" give-donation-level-btn give-btn give-btn-level-2 " value="50.00">$50</button></li>
<li><button type="button" data-price-id="3" class=" give-donation-level-btn give-btn give-btn-level-3 " value="75.00">$75</button></li>
</ul>
另外,如何在单击时使所选金额按钮带有黄色边框?
http://74.220.215.60/~xthrdmac/green/home-4-2/
最佳答案
尝试这个:-
ul { text-align: center; }
li { display: inline-block; } /* Don't float them */