可以't型单选按钮引导程序
Can't style radio buttons bootstrap?
我添加了内联样式表来给这两个单选按钮上色,但这两个按钮仍然是蓝色的,它们没有变成红色或绿色。这就是代码,你能帮我找到代码中的错误吗?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head
content must come *after* these tags -->
<title>Ristorante Con Fusion</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/bootstrap-social.css" rel="stylesheet">
<link href="css/mystyles.css" rel="stylesheet">
</head>
<body> <form class="form-horizontal" role="form">
<div class="form-group">
<label for="btn-group" class="col-xs-12 col-sm-2 control-label">Sections</label>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="options" id="option1" autocomplete="off" style ="background-color:red;" checked > True
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="option3" style="background-color: green;" autocomplete="off"> False
</label>
</div></div>
</form><!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>
</body>
</html>
</body>
</html>
将类btn-primary
更改为btn-success
,使其变为绿色,将btn-danger
更改为红色
您正在设置单选按钮本身的样式,但使按钮变蓝的是包含它的标签
<label class="btn btn-primary active" style ="background-color:red;">
<input type="radio" name="options" id="option1" autocomplete="off" checked > True
</label>
<label class="btn btn-primary" style="background-color: green;">
<input type="radio" name="options" id="option3" autocomplete="off"> False
</label>
相关文章:
- 谷歌应用程序脚本示例-如何更改单选按钮的列表框相关值
- 数据切换=“;按钮”;在JavaScript中无法识别引导程序单选按钮
- 禁用引导程序3中的单选按钮
- 显示禁用单选按钮引导程序3的工具提示
- 如何在引导程序3中验证单选按钮
- jquery:$(input).keydown无法在单选按钮上设置处理程序,同样的代码也适用于文本
- 击倒+引导3个单选按钮
- 单击从Android应用程序到HTML页面的单选按钮
- 引导设置单选按钮与 jquery 一起检查
- MVC / 引导 - 组中的单选按钮在初始化时未选择
- 引导 3 个单选按钮双切换
- 隐藏Zend单选按钮和复选框标签在javascript点击处理程序中
- 这是在引导程序中将单选按钮设置为“选中”的正确方法吗?
- 引导程序中的引导单选按钮没有样式不可更改
- 获取引导程序单选按钮文本-jquery
- 可以't型单选按钮引导程序
- 单选按钮引导面板不工作
- 使用data-toggle="button "显示/隐藏DIV输入单选按钮引导3
- jQuery改变事件处理程序不调用引导单选按钮
- 输入焦点不工作/不能选择单选按钮-引导