bootstrap基礎(chǔ)
bootstra里面的布局模式
固定布局 container
流動(dòng)布局 container-fluid
<div class="container-fluid" style=" border: 1px solid black;height: 100px">
網(wǎng)格系統(tǒng)類似于table tr td
網(wǎng)格系統(tǒng)一行大12列
row行
col--列
代表屏幕分辨率
sm 小 540px
md 中 720px
lg 大
xl
col-xl-auto根據(jù)內(nèi)容自動(dòng)分配
col--num 列 后面的代表跨幾列
offset-1 設(shè)置marginleft值 8.333%
offset--2 不同的屏幕marginleft
invisible隱藏元素
visible顯示元素
p-0 padding:0
p-1 padding:0.25rem;
p-2
pt
py
w-100 100%
w-75 75%
h-100 100%
h-50 50%
align-items-center 相對(duì)父容器垂直居中p-0
align-items-start 相對(duì)父容器頂部對(duì)齊
align-items-end 相對(duì)父容器底部對(duì)齊
align-content-center 考慮多行
align-self-center 自身在flexbox中的y軸分布
justify-content-center 子元素在父容器里面的x軸的排布情況
12個(gè)均分,大小一樣
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">1</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">2</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">3</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">4</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">5</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">6</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">7</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">8</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">9</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">10</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">11</div>
<div class="col-sm-1 col-lg-1 col-md-1 col-xl-1">12</div>
1 2 3 3:2:7
<div class="col-sm-2 col-lg-1 col-md-4 col-xl-3">1</div>
<div class="col-sm-8 col-lg-6 col-md-4 col-xl-2">2</div>
<div class="col-sm-2 col-lg-5 col-md-4 col-xl-7">3</div>
5個(gè)均分,大小一樣
<div class="col">1</div>
<div class="col">2</div>
<div class="col">3</div>
<div class="col">4</div>
<div class="col">5</div>
pt-1 <div class="pt-1 col">1</div>
<div class="col">2</div>
<div class="col">3</div>
py-1 <div class="py-1 col">1</div>
<div class="col">2</div>
<div class="col">3</div>
w-100 <div class="w-100 col">1</div>
<div class="col">2</div>
<div class="col">3</div>
h-100 <div class="h-100 col">1</div>
<div class="col">2</div>
<div class="col">3</div>
1 2 3 連起來居中豎直
<div class="row align-content-center" style="border: 1px solid red; height: 300px">
<div class="col-lg-1 " style="height: 60px; border: 1px solid black">1</div>
<div class="w-100"></div>
<div class="col-lg-1" style="height: 60px; border: 1px solid black">2</div>
<div class="w-100"></div>
<div class="col-lg-1" style="height: 60px; border: 1px solid black">3</div>
</div>
1居中 2 3
<div class="row" style="border: 1px solid red; height: 300px">
<div class="col-lg-1 align-self-center" style="height: 60px; border: 1px solid black">1</div>
<div class="col-lg-1 align-self-end" style="height: 60px; border: 1px solid black">2</div>
<div class="col-lg-1" style="height: 60px; border: 1px solid black">3</div>
</div>
123接起來居中 水平
<div class="row justify-content-center" style="border: 1px solid red; height: 300px">
<div class="col-lg-1" style="height: 60px; border: 1px solid black">1</div>
<div class="col-lg-1" style="height: 60px; border: 1px solid black">2</div>
<div class="col-lg-1" style="height: 60px; border: 1px solid black">3</div>
</div>
媒體查詢
@media (min-width: 576px) {
.block{
width: 560px;
}
}
@media (min-width: 768px) {
.block{
width: 750px;
}
}
@media (min-width: 992px) {
.block{
width: 980px;
}
}
@media (min-width: 1200px) {
.block{
width: 1140px;
}
}
min-width要從小到大
@media (max-width: 1200px) {
.block{
width: 1140px;
}
}
@media (max-width: 992px) {
.block{
width: 980px;
}
}
@media (max-width: 768px) {
.block{
width: 750px;
}
}
@media (max-width: 576px) {
.block{
width: 560px;
}
}
max-width要從大到小
@media (max-width: 1200px) and (min-width: 993px) {
.block{
width: 1140px;
}
}
@media (max-width: 992px) and (min-width: 769px) {
.block{
width: 980px;
}
}
@media (max-width: 768px) and (min-width: 577px) {
.block{
width: 750px;
}
}
@media (max-width: 576px) {
.block{
width: 560px;
}
}
元素浮動(dòng)根據(jù)分辨率去選擇
float-left左浮動(dòng)
float-right右浮動(dòng)
text-center 水平居中 left right justify sm xl md lg
<div class="row text-warning">
bootstrap
</div>
<div>
<span class="h2">bootstrap</span> 大小不同
<span class="h3">bootstrap</span>
<span class="h4">bootstrap</span>
<span class="h5">bootstrap</span>
<span class="small">bootstrap</span> small是正常大小的80%
<span class="close">×</span> 關(guān)閉特效 鼠標(biāo)有點(diǎn)擊效果 已經(jīng)做好的
</div>
<ul class="list-inline">
<li>bootstrap</li>
<li>bootstrap</li> 豎著排列
<li>bootstrap</li>
<li>bootstrap</li>
<li>bootstrap</li>
</ul>
<ul>
<li class="list-inline-item">bootstrap</li>
<li class="list-inline-item">bootstrap</li> 橫著排列
<li class="list-inline-item">bootstrap</li>
<li class="list-inline-item">bootstrap</li>
<li class="list-inline-item">bootstrap</li>
</ul>
圖片響應(yīng)式 img-fluid max-width:100% img-thumbnail 圖片外邊框加圓角
<div class="col-lg-1 float-left"><img class="img-fluid rounded " src="./img/1.jpg" alt=""/></div>
<div class="col-lg-1 float-right"><img class="img-fluid rounded " src="./img/1.jpg" alt=""/></div>
rounded
一些顏色屬性
table-primary table-danger table-success table-dark table-lighttable-info table-secondary
<table class="table table-hover table-bordered table-striped">
<tr class="table-active ">
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
</table>
響應(yīng)式圖片比父容器大
code顏色字體
kbd黑底白色
samp加粗的樣子
img-thumbnail圓角
mx-aoto左右
組件alert alert-success alert-dismissible
<button>
提示框動(dòng)畫
膠囊形狀
進(jìn)度條
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
分享標(biāo)題:bootstrap基礎(chǔ)-創(chuàng)新互聯(lián)
文章來源:http://www.rwnh.cn/article32/dcicpc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營(yíng)銷推廣、營(yíng)銷型網(wǎng)站建設(shè)、定制網(wǎng)站、網(wǎng)站收錄、面包屑導(dǎo)航、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容