我试图对齐 Bootstrap 单选按钮组,但没有工作。我的代码块如下。
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<div class="info-box">
<span class="info-box-icon bg-info"><i class="fas fa-shopping-cart"></i></span>
<div class="info-box-content">
<span class="info-box-text">Purchase</span>
<div class="btn-group btn-group-toggle float-right" data-toggle="buttons" style="width:50%">
<label class="btn btn-xs btn-success active">
<input type="radio" name="options" id="option_a1" autocomplete="off" checked> Full Access
</label>
<label class="btn btn-xs btn-outline-secondary">
<input type="radio" name="options" id="option_a2" autocomplete="off"> View Only
</label>
<label class="btn btn-xs btn-danger">
<input type="radio" name="options" id="option_a3" autocomplete="off"> Restricted
</label>
</div>
</div>
</div>
3条答案
按热度按时间apeeds0o1#
将 Bootstrap 链接到头部并尝试
ktca8awb2#
您的代码正在运行。可能您没有正确链接 Bootstrap 。
试试这个:
lztngnrs3#
您可以在Bootstrap v4中试用此功能吗