亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

詳解Bootstrap網(wǎng)格垂直和水平對(duì)齊方式

 更新時(shí)間:2021年07月06日 09:58:39   作者:俺老劉  
網(wǎng)格在網(wǎng)頁(yè)布局中是一個(gè)重點(diǎn)和難點(diǎn),布局是網(wǎng)頁(yè)設(shè)計(jì)的起點(diǎn)和基礎(chǔ),本文主要介紹了Bootstrap網(wǎng)格垂直和水平對(duì)齊方式,感興趣的可以了解一下

1、Bootstrap網(wǎng)格布局

上一節(jié)我們介紹了Bootstrap中的網(wǎng)格,網(wǎng)格在網(wǎng)頁(yè)布局中是一個(gè)重點(diǎn)和難點(diǎn),布局是網(wǎng)頁(yè)設(shè)計(jì)的起點(diǎn)和基礎(chǔ),一定要花功夫弄懂,最起碼把我寫(xiě)的教程介紹的內(nèi)容弄懂,因?yàn)槲覍?xiě)的都是最常用的和最基礎(chǔ)的。當(dāng)然對(duì)于一個(gè)有一定基礎(chǔ)的網(wǎng)頁(yè)設(shè)計(jì)師,這些內(nèi)容相信一看就懂,今天我們進(jìn)一步學(xué)習(xí)網(wǎng)格布局。

本節(jié)內(nèi)容涉及到通用類的彈性盒子(Flex)中的部分功能。

2、垂直對(duì)齊

2.1 row標(biāo)簽中設(shè)置垂直對(duì)齊

通過(guò)在row標(biāo)簽中 添加align-items-start、align-items-center、align-items-end可以更改行在容器中的垂直對(duì)齊方式,以上三個(gè)標(biāo)簽分別為頂部對(duì)齊、居中對(duì)齊、底部對(duì)齊。以下是一段演示代碼和效果圖,代碼中css代碼設(shè)置背景色和間距,方便查看效果。

<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="bootstrap5/bootstrap.min.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="stylesheet">
    <style>
      .row{background-color: rgba(0, 0, 255, 0.178);height: 260px;margin:30px;}
      .col{background-color: rgba(101, 101, 161, 0.842);height: 80px;padding: 30px;margin: 10px;}
    </style>
    <title>垂直對(duì)齊演示</title>
  </head>
  <body>
        <div class="container">

          <div class="row align-items-start">
            <div class="col"> </div>
            <div class="col"></div>
            <div class="col"></div>
          </div>

          <div class="row align-items-center">
            <div class="col"> </div>
            <div class="col"></div>
            <div class="col"></div>
          </div>

          <div class="row align-items-end">
            <div class="col"> </div>
            <div class="col"></div>
            <div class="col"></div>
          </div>

        </div>
   
     <script src="bootstrap5/bootstrap.bundle.min.js" ></script>
  </body>
</html>

2.2 col標(biāo)簽中設(shè)置垂直對(duì)齊

通過(guò)在col標(biāo)簽中 添加align-self-start、align-self-center、align-self-end可以更改列在行中的垂直對(duì)齊方式,以上三個(gè)標(biāo)簽分別為頂部對(duì)齊、居中對(duì)齊、底部對(duì)齊。以下是一段演示代碼和效果圖,代碼中css代碼設(shè)置背景色和間距,方便查看效果。

<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="bootstrap5/bootstrap.min.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="stylesheet">
    <style>
      .row{background-color: rgba(0, 0, 255, 0.178);height: 260px;margin:30px;}
      .col{background-color: rgba(101, 101, 161, 0.842);height: 80px;padding: 30px;margin: 10px;}
    </style>
    <title>垂直對(duì)齊演示</title>
  </head>
  <body>
        <div class="container">

          <div class="row align-items-start">
            <div class="col  align-self-start"> </div>
            <div class="col align-self-center"></div>
            <div class="col align-self-end"></div>
          </div>

        </div>
   
     <script src="bootstrap5/bootstrap.bundle.min.js" ></script>
  </body>
</html>

3、水平對(duì)齊

3.1 row標(biāo)簽中設(shè)置垂直對(duì)齊

通過(guò)在row標(biāo)簽中 添加justify-content-start、justify-content-center、justify-content-end、justify-content-around、justify-content-between、justify-content-evenly可以更改列在行中的水平對(duì)齊方式。以下是一段演示代碼和效果圖,代碼中css代碼設(shè)置背景色和間距,方便查看效果。

<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="bootstrap5/bootstrap.min.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="stylesheet">
    <style>
     .row{background-color: rgba(0, 0, 255, 0.178);height: 120px;margin:10px;}
      .col-4{background-color: rgba(101, 101, 161, 0.842);height: 30px;padding: 10px;margin: 10px;}
    </style>
    <title>垂直對(duì)齊演示</title>
  </head>
  <body>
        <div class="container">

          <div class="row justify-content-start">
            <div class="col-4"> </div>
            <div class="col-4"></div>
            <div class="col-4"></div>
          </div>

          <div class="row justify-content-center">
            <div class="col-4"> </div>
            <div class="col-4"></div>
            <div class="col-4"></div>
          </div>

          <div class="row justify-content-end">
            <div class="col-4"> </div>
## <div class="col-4"></div>
            <div class="col-4"></div>
          </div>

          <div class="row justify-content-around">
            <div class="col-4"> </div>
            <div class="col-4"></div>
            <div class="col-4"></div>
          </div>

          <div class="row justify-content-between">
            <div class="col-4"> </div>
            <div class="col-4"></div>
            <div class="col-4"></div>
          </div>

          <div class="row justify-content-evenly">
            <div class="col-4"> </div>
            <div class="col-4"></div>
            <div class="col-4"></div>
          </div>
        </div>

到此這篇關(guān)于詳解Bootstrap網(wǎng)格垂直和水平對(duì)齊方式的文章就介紹到這了,更多相關(guān)Bootstrap網(wǎng)格垂直和水平對(duì)齊方式內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • js canvas實(shí)現(xiàn)寫(xiě)字動(dòng)畫(huà)效果

    js canvas實(shí)現(xiàn)寫(xiě)字動(dòng)畫(huà)效果

    這篇文章主要為大家詳細(xì)介紹了js canvas實(shí)現(xiàn)寫(xiě)字動(dòng)畫(huà)效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-11-11
  • 探索瀏覽器頁(yè)面關(guān)閉window.close()的使用詳解

    探索瀏覽器頁(yè)面關(guān)閉window.close()的使用詳解

    這篇文章主要介紹了探索瀏覽器頁(yè)面關(guān)閉window.close()的使用詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-08-08
  • js實(shí)現(xiàn)簡(jiǎn)單的獲取驗(yàn)證碼按鈕效果

    js實(shí)現(xiàn)簡(jiǎn)單的獲取驗(yàn)證碼按鈕效果

    本文主要介紹了js實(shí)現(xiàn)簡(jiǎn)單的獲取驗(yàn)證碼按鈕加效果的實(shí)例,具有很好的參考價(jià)值。下面跟著小編一起來(lái)看下吧
    2017-03-03
  • Wordpress ThickBox 點(diǎn)擊圖片顯示下一張圖的修改方法

    Wordpress ThickBox 點(diǎn)擊圖片顯示下一張圖的修改方法

    Wordpress自帶的ThickBox特效中,單擊圖片會(huì)調(diào)用 tb_remove 以關(guān)閉特效窗口,現(xiàn)將修改其動(dòng)作為顯示下一張圖。
    2010-12-12
  • js 火狐下取本地路徑實(shí)現(xiàn)思路

    js 火狐下取本地路徑實(shí)現(xiàn)思路

    火狐下取本地全路徑使用js代碼實(shí)現(xiàn),感興趣的朋友可以參考下哈,希望可以幫助到你
    2013-04-04
  • JavaScript 命名空間 使用介紹

    JavaScript 命名空間 使用介紹

    使用JavaScript實(shí)現(xiàn)命名空間就沒(méi)有這么舒服了,Javascript只有函數(shù)作用域,什么塊兒啊、神馬文件啊統(tǒng)統(tǒng)都認(rèn)為是一個(gè)命名空間的,有時(shí)候因?yàn)橐恍┲孛麊?wèn)題導(dǎo)致的錯(cuò)誤讓人莫名其妙,難以調(diào)試解決
    2013-08-08
  • js中join()方法舉例詳解

    js中join()方法舉例詳解

    這篇文章主要給大家介紹了關(guān)于js中join()方法的相關(guān)資料,join方法用于把數(shù)組中的所有元素放入一個(gè)字符串,文中通過(guò)代碼以及圖文介紹的非常詳細(xì),需要的朋友可以參考下
    2023-10-10
  • 讓你一句話理解閉包(簡(jiǎn)單易懂)

    讓你一句話理解閉包(簡(jiǎn)單易懂)

    下面小編就為大家?guī)?lái)一篇一句話理解閉包(簡(jiǎn)單易懂)。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2016-06-06
  • js如何調(diào)用qq互聯(lián)api實(shí)現(xiàn)第三方登錄

    js如何調(diào)用qq互聯(lián)api實(shí)現(xiàn)第三方登錄

    這篇文章主要介紹了js如何調(diào)用qq互聯(lián)api實(shí)現(xiàn)第三方登錄,需要的朋友可以參考下
    2014-03-03
  • indexOf 和 lastIndexOf 使用示例介紹

    indexOf 和 lastIndexOf 使用示例介紹

    indexOf是在一個(gè)字符串中尋找一個(gè)字的位置,lastIndexOf 也是找字 , 它們倆的區(qū)別是前者從字符串頭開(kāi)始找,后者是從字符串末端開(kāi)始找
    2014-09-09

最新評(píng)論