1.运行效果如图所示
2.实现代码如下
<!DOCTYPEhtml><html><head><metacharset="utf-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><title>表单控件——单选按钮水平排列</title><!--最新版本的Bootstrap核心CSS文件--><linkrel="stylesheet"href="/bootstrap/3.3.7/css/bootstrap.min.css"integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"crossorigin="anonymous"><!--可选的Bootstrap主题文件(一般不用引入)--><linkrel="stylesheet"href="/bootstrap/3.3.7/css/bootstrap-theme.min.css"integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"crossorigin="anonymous"></head><body><formrole="form"><divclass="form-group"><labelclass="radio-inline"><inputtype="radio"value="option1"name="sex">男性</label><labelclass="radio-inline"><inputtype="radio"value="option2"name="sex">女性</label><labelclass="radio-inline"><inputtype="radio"value="option3"name="sex">中性</label></div></form><scriptsrc="/jquery/3.2.1/jquery.min.js"></script><!--最新的Bootstrap核心JavaScript文件--><scriptsrc="/bootstrap/3.3.7/js/bootstrap.min.js"integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"crossorigin="anonymous"></script></body></html>
如果觉得《bootstrap-表单控件——单选按钮水平排列》对你有帮助,请点赞、收藏,并留下你的观点哦!