• <noscript id="ggggg"><dd id="ggggg"></dd></noscript>
    <small id="ggggg"></small> <sup id="ggggg"></sup>
    <noscript id="ggggg"><dd id="ggggg"></dd></noscript>
    <tfoot id="ggggg"></tfoot>
  • <nav id="ggggg"><cite id="ggggg"></cite></nav>
    <nav id="ggggg"></nav>
    成人黃色A片免费看三更小说,精品人妻av区波多野结衣,亚洲第一极品精品无码,欧美综合区自拍亚洲综合,久久99青青精品免费观看,中文字幕在线中字日韩 ,亚洲国产精品18久久久久久,黄色在线免费观看

    兩欄布局

    2019-11-29    seo達人

    兩列布局的幾種方法

    html結構

     <div class="content">

          <div class="content-left">

            左側固定200px

          </div>

          <div class="content-right">

            右側自適應

          </div>

     </div>



    1.通過float和margin-left

     / 清除瀏覽器默認邊距 /

          {

            margin: 0;

            padding: 0;

          }



          .content{

            overflow: hidden;

          }

          /
    脫離文檔流 /

          .content-left {

            float: left;

            width: 200px;

            height: 200px;

            background: red;

          }



          .content-right {

            /
    通過margin-left將左邊位置空出 /

            margin-left: 200px;

            background: blue;

            height: 200px;

          }



    2.通過 position: absolute;絕對定位

     /
    清除瀏覽器默認邊距 /

         
    {

            margin: 0;

            padding: 0;

          }



          .content {

            overflow: hidden;

            position: relative;

          }

          / 脫離文檔流 /

          .content-left {

            position: absolute;

            top: 0;

            left: 0;

            width: 200px;

            height: 200px;

            background: red;

          }



          .content-right {

            / 通過margin-left將左邊位置空出 /

            margin-left: 200px;

            background: blue;

            height: 200px;

          }



    3.通過flex彈性布局

    / 清除瀏覽器默認邊距 /

          {

            margin: 0;

            padding: 0;

          }



          .content {

            overflow: hidden;

            display: flex;

          }

          .content-left {

              /
    除了width: 200px;還可以flex-basis: 200px; /

            width: 200px;

            height: 200px;

            background: red;

          }



          .content-right {

              /
    flex:1;將剩余空間分給它 /

            flex: 1;

            background: blue;

            height: 200px;

          }



    4.通過 display: table;表格布局

     /
    清除瀏覽器默認邊距 /

         
    {

            margin: 0;

            padding: 0;

          }



          .content {

            overflow: hidden;

            display: table;

            / 必須給父級定寬不然自適應盒子沒定寬只會由內容撐開 /

            width: 100%;

          }

          .content-left {

            display: table-cell;

            width: 200px;

            height: 200px;

            background: red;

          }



          .content-right {

            display: table-cell;

            background: blue;

            height: 200px;

          }



    5.通過inline-block和calc()函數

     / 清除瀏覽器默認邊距 /

          {

            margin: 0;

            padding: 0;

          }



          .content {

            /
    必須加font-size=0;把inline-block默認間距去掉,

            不過設置后里面文字不顯示了可以給里面塊設置font-size:20px;

            或者把兩個塊之間的換行刪掉也能去掉間距/

            font-size: 0;

            overflow: hidden;

          }

          .content-left {

            font-size: 20px;

            display: inline-block;

            width: 200px;

            height: 200px;

            background: red;

          }



          .content-right {

            font-size: 20px;

            display: inline-block;

            background: blue;

            height: 200px;

            /
    注意calc里的運算符兩邊要有空格 /

            width: calc(100% - 200px);

          }



    6.通過float和calc()函數,左右兩塊都要浮動

     /
    清除瀏覽器默認邊距 /

         
    {

            margin: 0;

            padding: 0;

          }



          .content {

            overflow: hidden;

          }

          .content-left {

            float: left;

            width: 200px;

            height: 200px;

            background: red;

          }

          .content-right {

            float: left;

            background: blue;

            height: 200px;

            / 注意calc里的運算符兩邊要有空格 /

            width: calc(100% - 200px);

          }



    7.使用grid布局

     / 清除瀏覽器默認邊距 /

          {

            margin: 0;

            padding: 0;

          }



          .content {

            overflow: hidden;

            display: grid;

            grid-template-columns: 200px 1fr;

            /
    grid布局也有列等高的默認效果。需要設置: align-items: start;。 /

            align-items: start;

          }

          .content-left {

            height: 200px;

            background: red;

            /
    grid布局還有一個值得注意的小地方和flex不同:在使用margin-left的時候,

            grid布局默認是box-sizing設置的盒寬度之間的位置。

            而flex則是使用兩個div的border或者padding外側之間的距離。 */

            box-sizing: border-box;

            grid-column: 1;

          }

          .content-right {

            background: blue;

            height: 200px;

            box-sizing: border-box;

            grid-column: 2;

          }



    日歷

    鏈接

    個人資料

    藍藍設計的小編 http://www.lzhte.cn

    存檔

    主站蜘蛛池模板: 国产精品三级国产电影| 888亚洲欧美国产VA在线播放| 国产精品无码专区第一页| 中文字幕一区二区人妻出轨| 99精品自拍| 精品国产国产AV一区二区| 亚洲av综合色区无码专区| 日本不卡在线视频高清免费| 国产欧美亚洲精品第一页在线| 岛国av免费在线播放| 9191精品国产观看| 51精品视频一区二区三区| 久久久亚洲欧洲日产国产成人无码| japanese残忍掏死asspics| 欧美成人www免费全部网站| 中文字幕亚洲综合小综合在线| 久青草国产在视频在线观看| 午夜福利十八周岁成人| 亚洲av第一区第二区| 平罗县| 人妻中文字幕精品系列| 伊人久久大香线蕉av色| 中文字幕亚洲精品二区| 国产成人在线观看免费网站| 五月花av| 超碰人人人人| 亚洲国产精品午夜电影| 色八区人妻在线视频| 欧美日韩亚洲一区二区精品| 亚洲精品乱码久久久久久蜜桃| 亚洲精品久久久久中文字幕一福利| 四虎成人精品国产一区a| 免费国产在线观看不卡| 国产一区二区福利视频| 尤物亚洲AV无码精品色午夜| 国产欧美日韩在线不卡第一页| 亚洲五月六月丁香激情| 麻豆激情在线免费观看视频| 日本中文一二区有码在线| 色婷婷在线精品国自产拍| 久久久国产精品人人片|