• <center id="sm46c"></center>
  • <dfn id="sm46c"></dfn>
  • <strike id="sm46c"></strike>
  • <cite id="sm46c"><source id="sm46c"></source></cite>
    • <strike id="sm46c"><source id="sm46c"></source></strike>
      <option id="sm46c"></option>
      国产精品天天看天天狠,女高中生强奷系列在线播放,久久无码免费的a毛片大全,国产日韩综合av在线,亚洲国产中文综合专区在,特殊重囗味sm在线观看无码,中文字幕一区二区三区四区在线,无码任你躁久久久久久老妇蜜桃

      兩欄布局

      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.li-bodun.cn

      存檔

      主站蜘蛛池模板: 中文字幕日韩精品有码视频| 2021国产精品自拍| 国产日韩另类综合11页| 久久免费精品视频| 国产精品你懂得| 国产91久久精品成人看| 精品久久综合1区2区3区激情| 国产粉嫩系列一区二区三| 古交市| 亚洲日韩国产二区无码| 波多野衣结在线精品二区| 国产精品户外野外| 国色精品卡一卡2卡3卡4卡在线| 久久免费午夜福利院| 亚洲色一区二区三区四区| 国内精品久久久久久久97牛牛| 午夜爽爽视频| 久久成人国产精品免费软件| 国产精品无圣光一区二区| 亚洲国产精品高清久久久| 少妇人妻偷人免费观看| 亚洲成A人一区二区三区| 亚洲av精彩一区二区| 偷偷做久久久久网站| 在线观看人成视频免费| 阳谷县| 99久久国产综合精品色| 久久人人97超碰国产精品| 人伦片无码中文字幕| 无码中文字幕日韩专区| 久久精品人人做人人爽电影蜜月| 国产精品久久久福利| 亚洲成av人片不卡无码| 国产乱人伦偷精品视频不卡| 四虎成人在线| 亚洲热视频这里只有精品| 亚洲欧美日韩精品中文乱码 | 国产日韩一区二区在线| 欧美性xxxx极品少妇| 六月丁香综合在线视频| 61精品人妻一区二区三区|