网站首页 > 基础教程 正文
大学生就可以看懂的bootstrap基础实战系列,pre标签里是笔记总结,动手实际操作一下会加强理解。有疑问留言交流哦。
bootstrap是进阶html5很基础常用的前端框架,可以做自适应漂亮的界面,再坚持一下,前端知识的大门就会打开了。
本节内容有动态显示效果,建议实际操作一下。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link href="bootstrap.css" rel="stylesheet"> <style> .aui-ul li { margin-left: 10px; } .aui-ul-lg li:before { color: #ff50d7; } .aui-ul-md li:before { color: #1c15ff; } .aui-ul-sm li:before { color: #ff0f2e; } .aui-ul li:before { content: "\f8ff"; margin-right: 15px; position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } @media (min-width: 992px) and (max-width: 1199px) { .aui-ul li:before { color: #ff50d7; } } @media (min-width: 767px) and (max-width: 992px) { .aui-ul li:before { color: #8e36e8; } } @media (min-width: 767px) { .aui-ul li:before { color: #2f25e8; } } </style> </head> <body> <pre> 实现下拉框需要依赖bootstrap的css和js,js引入前引入jquery. 整个div是:dropdown ,按钮是:dropdown-toggle ,按钮还必须加bootstrap自定义属性data-toggle为"dropdown",列表用dropdown-menu. li前面放置icon字体: before伪元素 .aui-ul li:before { content: "\f8ff"; margin-right: 15px; color: red; position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } </pre> <div class="container"> <div class="row"> <div class="col-md-2 "> 下拉框 </div> <div class="col-md-10 "> <div class="dropdown"> <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">选择 <span class="glyphicon glyphicon-hand-down"></span></button> <ul class="dropdown-menu aui-ul"> <li class="text-left ali visible-lg" style="">lg 1</li> <li class="text-left ali visible-md" style="">md 1</li> <li class="text-left ali visible-sm" style="">sm 1</li> <li class="text-left ali visible-xs" style="">xs 1</li> <li class="text-left ali">2</li> <li class="text-left ali">3</li> </ul> </div> </div> </div> <div class="row"> <div class="col-md-2 "> 下拉框 </div> <div class="col-md-10 "> <div class="dropdown"> <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">选择 <span class="glyphicon glyphicon-hand-down"></span></button> <ul class="dropdown-menu aui-ul "> <li class="text-left ali " style=""> 1</li> <li class="text-left ali">2</li> <li class="text-left ali">3</li> </ul> </div> </div> </div> </div> </body> <!--先引入jquery--> <script src="jquery.js"></script> <script src="bootstrap.js"></script> </html>
猜你喜欢
- 2024-11-11 UI组件库Kendo UI for Angular入门指南教程 - Button(按钮)
- 2024-11-11 Bootstrap:CSS之光荣 美的css售后服务新系统登陆
- 2024-11-11 DTD怎样进行元素类型定义?【语法格式】
- 2024-11-11 React常用按钮组件示例 react sidebar
- 2024-11-11 七爪源码:React-Bootstrap UI 库入门
- 2024-11-11 2021,排名前 15 的 Vue 后台管理模板
- 2024-11-11 BootStrap简介及应用要点 bootstrap介绍和优点
- 2024-11-11 BootstrapBlazor实战 Chart 图表使用(1)
- 2024-11-11 22、Bootstrap 常用组件有哪些?(了解)
- 2024-11-11 七爪源码:在 React 中开始使用 Bootstrap
- 最近发表
- 标签列表
-
- jsp (69)
- gitpush (78)
- gitreset (66)
- python字典 (67)
- dockercp (63)
- gitclone命令 (63)
- dockersave (62)
- linux命令大全 (65)
- pythonif (86)
- location.href (69)
- dockerexec (65)
- tail-f (79)
- queryselectorall (63)
- location.search (79)
- bootstrap教程 (74)
- deletesql (62)
- linuxgzip (68)
- 字符串连接 (73)
- html标签 (69)
- c++初始化列表 (64)
- mysqlinnodbmyisam区别 (63)
- arraylistadd (66)
- mysqldatesub函数 (63)
- window10java环境变量设置 (66)
- c++虚函数和纯虚函数的区别 (66)