bootstrap guide

bootstrap

    • 1. bootstrap 简单介绍
    • 2. demo演示
    • 3. 关于bootstrap使用注意的点

1. bootstrap 简单介绍

  1. 起源
 来自Twitter,是目前最受欢迎的前端框架。基于HTMLCSS、Javascript。Bootstrap js组件依赖于jquery 3.X简洁灵活,使得Web开发更加快捷。
  1. 官网
    https://getbootstrap.com/
  2. 中文文档网站
    https://v3.bootcss.com/
  3. cdn引入
<!-- CSS only -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"><!-- JS, Popper.js, and jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
  1. 页面引入
	// css样式<link rel="stylesheet" href="css/bootstrap.css" />// bootstrap js组件 依赖jQuery<script type="text/javascript" src="js/jquery-3.4.1.js" ></script>// bootstrap js组件操作<script type="text/javascript" src="js/bootstrap.js" ></script>

2. demo演示

  1. 下拉框按钮 组件
<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><link rel="stylesheet" href="../css/bootstrap.css" /><script type="text/javascript" src="../../js/jquery-3.4.1.js" ></script><script type="text/javascript" src="../js/bootstrap.js" ></script><script>$(function() {// ready..});</script></head><body><!-- 下拉框按钮 --><div class="btn-group"><button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">do sth.. <span class="caret"></span></button><ul class="dropdown-menu"><li><a href="#">菜单</a></li><li><a href="#">跳转</a></li><li><a href="#">修改</a></li><li role="separator" class="divider"></li><li><a href="#">新增</a></li></ul></div></body>
</html>


2. js插件(结合jQuery)模态框 modal

<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title></title><link rel="stylesheet" href="../css/bootstrap.css" /><script type="text/javascript" src="../../js/jquery-3.4.1.js" ></script><script type="text/javascript" src="../js/bootstrap.js" ></script><script>$(function() {// ready..$("#save").on("click", function() {// 隐藏模态框$("#myModal").modal("hide");});});</script></head><body><!-- Button trigger modal  按钮触发模态框 data-target:取到对应的模态框--><button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">弹出模态框</button><!-- Modal 模态框 不显示 通过js触发 弹出 --><div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"><div class="modal-dialog" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="myModalLabel">请填写您的信息</h4></div><div class="modal-body">wirte some html code... <br/>email: <input type="text" /></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">关闭</button><button type="button" class="btn btn-primary" id="save">保存</button></div></div></div></div></body>
</html>


3. 关于更多例子学习,请看中文文档
https://v3.bootcss.com/


多查文档,多copy!

3. 关于bootstrap使用注意的点

  1. 和其它框架使用,如vue.js 注意效果会影响,不兼容
  2. 不支持h5的浏览器,导入第三方js包
 html5shiv.jsrespond.js
  1. 保证bootstrap的样式在不同的浏览器中保持一致
 Normalize.css 可选引入

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/420723.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

六、Analysis of quicksort

1 引言 如题目所示&#xff0c;本节的精华在于用数学解决一个直觉上看似纷乱复杂的问题&#xff0c;里面有一些一般性的分析方法&#xff0c;如引入Indicator变量&#xff0c;从而把不确定问题引入到概率框架进行分析&#xff0c;一步一步把直觉上混乱的问题理清楚&#xff0c…

Javaweb maven项目tomcat报错: javax.naming.NamingException: 无法创建资源实例

报错地址 2. 原因分析 1. Resource注解无效&#xff0c;注入失败&#xff0c;你得从容器中把bookInfoServie取去来&#xff0c;用getBean的方式创建BookInfoServiceImpl对象 2.删掉Resource注解&#xff0c;重新部署搞定。3.不要在意写了个Contorller, 初学spring&#xff0c;…

如何给APK文件签名

转载地址&#xff1a;http://www.apkbus.com/forum.php?modviewthread&tid1264211.签名的意义   为了保证每个应用程序开发商合法ID&#xff0c;防止部分开放商可能通过使用相同的Package Name来混淆替换已经安装的程序&#xff0c;我们需要对我们发布的APK文件进行唯一…

七、基于比较的排序算法总结

1 问题 至此&#xff0c;总结一下已经研究过的排序算法&#xff1a; insertion sort&#xff0c;Θ(n2)\Theta(n^2)Θ(n2) merge sort, Θ(nlogn)\Theta(nlogn)Θ(nlogn) quicksort, Θ(nlogn)\Theta(nlogn)Θ(nlogn) heapsort,Θ(nlogn)\Theta(nlogn)Θ(nlogn) 从上面这个现象…

转账为demo,spring事务

spring 事务使用1. 业务代码2. xml配置3. 注解配置1. 业务代码 数据表结构 dao package com.lovely.dao.impl;import com.lovely.dao.AccountDao; import org.springframework.jdbc.core.JdbcTemplate;/*** author echo lovely* date 2020/8/9 11:01*/ public class AccountD…

八、计数排序及其应用分析

1 本节思路 之前的算法的最基本的思想是比较元素大小&#xff0c;所以算法复杂度最好是Θ(nlogn)\Theta(nlogn)Θ(nlogn)&#xff0c;本节不再基于元素比较&#xff0c;而是基于计数的Counting sort&#xff0c;然后应用在Radix sort上。 2 Counting sort 2.1 算法思想 Cou…

Google开发者模式调试css样式的方法

界面如下&#xff0c;你需要调试css样式… 看下图&#xff0c;高仿某云播放界面部分 需求 1.h5开发手机端界面&#xff0c;禁用缩放 2.如何精准的定位像上图一样&#xff0c;或者更好 3.使用Google调试器&#xff0c;调试css样式如何调样式 选择对应的样式 确定多个元素…

OD汇编需要标签

如何解决&#xff0c;看那红体字。。。 push 0046ad70 标签就是地址的引用 zai破解的道路上面面前行 技术参考&#xff1a;http://zhidao.baidu.com/link?url8JP8KFxTinclhl6MwpaZw5buhtv1p4zgpjy8rKkBPvD4YqCq2uudXQZrhuBLPGZm5ahe3d7YsLb3MeAFDXfsua转载于:https://www.cnbl…

git与github使用

1 从github上clone到本地 配置Git 首先在本地创建ssh key&#xff1b; $ ssh-keygen -t rsa -C "your_emailyouremail.com"后面的your_emailyouremail.com改为你在github上注册的邮箱&#xff0c;之后会要求确认路径和输入密码&#xff0c;我们这使用默认的一路回车…

bootstrap panel 布局

panel1. 效果2. 基于bootstrap实现用于页面分专栏展示 1. 效果 成品 2. 基于bootstrap实现 <!DOCTYPE html> <html><head><meta charset"UTF-8"><title>panel 布局</title><link rel"stylesheet" href"cs…

35款让你爱不释手的网页元素PSD素材

网页元素是构成一个网页的基本元素&#xff0c;包括按钮、表单、文本框、进度条等。这里收集了30款让你爱不释手的网页元素PSD素材。 1、国外个性网页模板UI设计PSD素材 下载地址>>> 2、带分享按钮的网页导航栏UI设计PSD素材 下载地址>>> 3、两款简洁的搜索框…

DHCP中继

拓扑如下&#xff1a; R0配置&#xff1a; (config)#ip dhcp pool aaa (dhcp-config)#network 8.8.8.0 255.255.255.0 (dhcp-config)#default-router 8.8.8.1 (dhcp-config)#dns-server 114.114.114.114(config)#ip dhcp pool bbb (dhcp-config)#network 88.88.88.0 255.255.25…