BootStrap表单控件之复选框checkbox和单选择按钮radio
程序员文章站
2023-11-27 20:06:46
1.运行效果如图所示
2.实现代码如下
1.运行效果如图所示
2.实现代码如下
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>表单控件——复选框checkbox和单选择按钮radio</title> <!-- 最新版本的 bootstrap 核心 css 文件 --> <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="external nofollow" integrity="sha384-bvyiisifek1dgmjrakycuhahrg32omucww7on3rydg4va+pmstsz/k68vbdejh4u" crossorigin="anonymous"> <!-- 可选的 bootstrap 主题文件(一般不用引入) --> <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="external nofollow" integrity="sha384-rhyon1irsvxv4nd0jutlngaslcjuc7uwjduw9svrlvryoopp2bwygmgjqixwl/sp" crossorigin="anonymous"> </head> <body> <form role="form"> <h3>示例</h3> <div class="checkbox"> <label for=""> <input type="checkbox">记住密码 </label> </div> <div class="radio"> <label for=""> <input type="radio" name="optionsradios" id="optionsradios1" value="love" checked>喜欢 </label> </div> <div class="radio"> <label for=""> <input type="radio" name="optionsradios" id="optionsradios2" value="hate">不喜欢 </label> </div> </form> <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> <!-- 最新的 bootstrap 核心 javascript 文件 --> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-tc5iqib027qvyjsmfhjomalkfuwvxzxupncja7l2mcwnipg9mgcd8wgnicpd7txa" crossorigin="anonymous"></script> </body> </html>
以上所述是小编给大家介绍的bootstrap表单控件之复选框checkbox和单选择按钮radio,希望对大家有所帮助