BootStrap4 基础模版

新建 HTML 页面,复制下方代码粘入

BootStrap4 基础模版
<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="stylesheet" href="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/css/bootstrap.min.css">
  <title>Hello, world!</title>
</head>

<body>

<div class="container">
  <div class="row">

    <h1>添加上你的代码</h1>

  </div>
</div>

</body>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/popper.js/1.16.1/umd/popper.min.js"></script>
<script src="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(e){

});
</script>
</html>

实例精选

很多很多的现成的例子:http://v3.bootcss.com/getting-started/#examples

表格

<div class="container">
  <table class="table table-striped">
    <tr><th>序号</th><th>姓名</th><th>年龄</th></tr>
    <tr><td>888</td><td>张三</td><td>1000</td></tr>
  </table>
</div>

加上table基础样式之后才会附加表格样式

表格样式
属性作用
table基础样式
table-striped条纹状 表格
table-bordered带边框的表格
table-hover鼠标悬停
table-condensed紧缩表格

#####状态类

属性描述 作用
active活动灰
success成功绿
info提示蓝
warning警告黄
danger危险红
响应式表格

将任何 .table 元素包裹在 .table-responsive 元素内,即可创建响应式表格,其会在小屏幕设备上(小于768px)水平滚动。当屏幕大于 768px 宽度时,水平滚动条消失。

按钮

按钮样式可以添加给a标签,但是避免使用除botton之外的其他标签,不同设备兼容性方面可能会出现问题

<div class="container">
  <button type="button" class="btn btn-danger">按钮</button>
</div>
预定义样式

btn-default 默认样式 白
btn-primary 首选项 紫
btn-success 成功 绿
btn-info 一般信息 蓝
btn-warning 警告 橙
btn-danger 危险 红
btn-link 链接 蓝字下划线

尺寸

btn-lg 大按钮
btn-default 默认尺寸
btn-sm 小按钮
btn-xs 超小尺寸

<a href="" class="btn btn-default btn-lg" role="button">default</a>

通过给按钮添加 .btn-block 类可以将其拉伸至父元素100%的宽度,而且按钮也变为了块级(block)元素。

激活状态
<button type="button" class="btn btn-primary btn-lg **active**">Primary button</button>
<a href="#" class="btn btn-primary btn-lg **active**" role="button">Primary link</a>
禁用状态
<button type="button" class="btn btn-lg btn-primary" **disabled**>Primary button</button>

图片

为图片添加** .img-responsive **类可以让图片支持响应式布局。
如果需要让使用了 .img-responsive 类的图片水平居中,请使用 .center-block 类,不要用 .text-center。
#####图片形状

<img src="girl.jpg" class="img-rounded">
<img src="girl.jpg" class="img-circle">
<img src="girl.jpg" class="img-thumbnail">
一个功能齐全的仪表板和管理模板,带有精心设计的UI元素、组件、小部件和页面。超级干净和灵活的布局将使您可以轻松地构建Web应用程序。它可用于创建基于SaaS的界面、自定义管理面板、仪表板、CRM、CMS、电子商务面板等。 Hyper is a fully featured dashboard and admin template comes with tones of well designed UI elements, components, widgets and pages. The super clean and flexible layout would enable you to easily build web applications. It can be used to create a saas based interface, custom admin panels, dashboard, CRM, CMS, e-commerce panel, etc. Features: Built on latest bootstrap (v4.3.1) Easy customizations with extensive use of SCSS variables Fully responsive and works across all modern/supported browsers, devices Documentation on all available components, widgets, etc Easy development and tooling with Gulp workflow Components: All of Bootstrap components Icons Multiple widgets Toast Notifications Chartjs Charts Brite Charts Apex Charts Select2, Date Range Picker, Input Mask included Bootstrap form wizard Timepickers Spinner Max Length Validator Advanced Datatables Dragula – Simple Drag and Drop Multiple File Uploads WYSIWYG Editors (Summernote and SimpleMDE) Google and Vector Maps Layouts: Vertical Horizontal Detached Sidenav Light Sidenav Collapsed Sidenav Boxed (Fixed width) – Vertical and Horizontal Apps: Calendar Projects (List page, Detail Page) Tasks (List Page, Detail Modal, Add Task Modal) Ecommerce (Product listing, product detail, order listing, order detail, shopping cart, checkout, seller listing, etc) Pages: Sample Dashboard Profile Invoice FAQ Pricing Maintenance Login (Two variations) Register (Two variations) Logout (Two variations) Recover Password (Two variations) Lock Screen (Two variations) Confirm Mail (Two variations) Error 404 Error 500
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值