美文网首页程序员
bootstrap学习(一)

bootstrap学习(一)

作者: 小pxu | 来源:发表于2016-05-18 21:49 被阅读230次

一、全局样式style.css

移除body的maigin
背景白色
设置了基本的字体样式
设置全局链接样式,鼠标悬停时才会出现下划线

二、标题

重置h1~h6样式

重置了margin-top(h1h3:20px;h4h6:10px)
重置了margin-bottom(10px)
所有标题行高1.1(font-size的1.1),颜色字体继承父级
固定字体大小
h1:36px
h2:30px
h3:24px
h4:18px
h5:14px
h6:12px

标题演示

标题类名

效果与h1~h6标签相同

<div class="h1">hello world</div>
<div class="h2">hello world</div>
<div class="h3">hello world</div>
<div class="h4">hello world</div>
<div class="h5">hello world</div>
<div class="h6">hello world</div>
标题类名

副标题

字体大小继承父级的65%

<div class="h1">hello world<small>This is first bootstrap class</small></div>
副标题

三、强调内容

.lead一般配合段落标签使用

<p class="lead">我是段落我是段落我是段落我是段落我是段落我是段落我是段落我是段落</p>
<p>我是段落我是段落我是段落我是段落我是段落我是段落我是段落我是段落</p>
lead强调

颜色强调相关的类

.text-muted:提示,使用浅灰色(#999)
.text-primary:主要,使用蓝色(#428bca)
.text-success:成功,使用浅绿色(#3c763d)
.text-info:通知信息,使用浅蓝色(#31708f)
.text-warning:警告,使用黄色(#8a6d3b)
.text-danger:危险,使用褐色(#a94442)

<h1 class="text-muted">hello world</h1>
<h2 class="text-primary">hello world</h2>
<h3 class="text-success">hello world</h3>
<h4 class="text-info">hello world</h4>
<h5 class="text-warning">hello world</h5>
<h6 class="text-danger">hello world</h6>
颜色强调

四、文本对齐

.text-left:左对齐
.text-right:右对齐
.text-center:居中
.text-justify:两端对齐(这个没出效果,汗~~)

<p class="text-left">我是段落</p>
<p class="text-center">我是段落</p>
<p class="text-right">我是段落</p>
<p class="text-justify">我是段落</p>
对齐方式

五、列表

.list-unstyled:ul、ol除去序列样式
.list-inline:ul、ol水平列表
.dl-horizontal:dl水平列表

六、代码风格

多行代码中用.pre-scrollable使超出部分用滚动条控制显示

<pre class="pre-scrollable">
    function something(){
        console.log('haha')
    }
    function something(){
        console.log('haha')
    }
    function something(){
        console.log('haha')
    }
    function something(){
        console.log('haha')
    }
    function something(){
        console.log('haha')
    }
    function something(){
        console.log('haha')
    }
    function something(){
        console.log('haha')
    }
    function something(){
        console.log('haha')
    }
</pre>
代码滚动条

七、表格

基础表格

.table

原始样式

附加样式表格

.table-striped:斑马线

斑马线
.table-bordered:带边框 边框
.table-hover:鼠标悬停高亮 悬停高亮
.table-condensed:紧凑型(高度变小) 紧凑

响应式表格

当视窗宽度小于768px,且文字需要换行时出现滚动条

.responsive

响应式

八、图片

.img-responsive:响应式图片

响应式

.img-rounded:圆角风格

圆角

.img-cicle:圆形风格

圆形

.img-thumbnail:缩略图片(外边多个1px边框)

缩略

九、图标

Bootstrap框架中也为大家提供了近200个不同的icon图片,而这些图标都是使用CSS3的@font-face属性配合字体来实现的icon效果。

这些样式可以加载在任何标签中,不过通常来说都是使用的span标签

图标样式地址

标签样式

通过.glyphicon来实现获取

<span class="glyphicon glyphicon-road"></span>
<span class="glyphicon glyphicon-search"></span>
<span class="glyphicon glyphicon-log-in"></span>
<span class="glyphicon glyphicon-user"></span>
标签样式举例

相关文章

  • 学习网站资源

    Bootstrap :bootstrap学习网站 element:element学习地址 Flex: Flex 布...

  • Bootstrap初体验

    今天学习了Bootstrap的知识,没有学习Bootstrap之前,我一直以为是Bootstrap是一个很高大上的...

  • bootstrap学习(一)

    一、全局样式style.css 移除body的maigin背景白色设置了基本的字体样式设置全局链接样式,鼠标悬停时...

  • Bootstrap学习之二:栅格化布局

    @(Bootstrap) 导言 前面我们讲了如何安装使用bootstrap框架,下面我们将会学习bootstrap...

  • Bootstrap

    建议学习时长: 60分钟学习方式:了解 学习目标 知道 Bootstrap 是什么。 知道 Bootstrap 有...

  • 2018-10-08Bootstrap03

    Bootstrap 图片 在本章中,我们将学习 Bootstrap 对图片的支持。Bootstrap 提供了三个可...

  • Bootstrap学习

    很好的bootstrap学习教程:http://www.runoob.com/bootstrap/bootstra...

  • SpringBoot+Vue开发在线学习系统

    Spring Boot+Bootstrap+Vue开发在线学习系统 SpringBoot+Bootstrap+Vu...

  • Bootstrap学习

    移动端的js事件 1、touchstart: //手指放到屏幕上时触发2、touchmove: //手指在屏幕上滑...

  • bootstrap学习

    bootsrap的特点 跨设备,跨浏览器(但我们还是不考虑IE9以下的浏览器) 响应式布局 提供全面的组件 内置j...

网友评论

    本文标题: bootstrap学习(一)

    本文链接:https://www.haomeiwen.com/subject/hwiwrttx.html