【发布时间】:2018-02-06 15:12:20
【问题描述】:
在下面的示例中,如果我使用<label class="radio"> 作为标签并单击单选按钮的区域,它将扩展到页面的整个宽度。
单击此标签外部(内联标签旁边)仍会触发单选按钮。
我尝试将标签类设为inline。但单选按钮排列在一个单一的
行。
是否有任何其他引导程序class 可用于单选按钮/标签以将它们放在具有固定标签宽度的下一行中?
这是我的代码:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Form control: inline radio buttons</h2>
<p>The form below contains three inline radio buttons:</p>
<form>
<label class="radio">
<input type="radio" name="optradio">Option 1
</label>
<label class="radio">
<input type="radio" name="optradio">Option 2
</label>
<label class="radio">
<input type="radio" name="optradio">Option 3
</label>
</form>
</div>
</body>
</html>
【问题讨论】:
-
问题标记为 Boostrap 4,但您引用的是 Bootstrap 3。它是哪个?
标签: html css twitter-bootstrap-3