:::

10-2 水平對齊

  1. 靠左對齊 .justify-content-start
    <div class="container">
        <div class="row justify-content-start">
            <div class="col-2">col 1/3</div>
            <div class="col-2">col 2/3</div>
            <div class="col-2">col 3/3</div>
        </div>
    </div>
  2. 置中對齊 .justify-content-center
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-2">col 1/3</div>
            <div class="col-2">col 2/3</div>
            <div class="col-2">col 3/3</div>
        </div>
    </div>
  3. 靠右對齊 .justify-content-end
    <div class="container">
        <div class="row justify-content-end">
            <div class="col-2">col 1/3</div>
            <div class="col-2">col 2/3</div>
            <div class="col-2">col 3/3</div>
        </div>
    </div>
  4. 分散對齊(含左右) .justify-content-around
    <div class="container">
        <div class="row justify-content-around">
            <div class="col-2">col 1/3</div>
            <div class="col-2">col 2/3</div>
            <div class="col-2">col 3/3</div>
        </div>
    </div>
  5. 分散對齊(不含左右) .justify-content-between
    <div class="container">
        <div class="row justify-content-between">
            <div class="col-2">col 1/3</div>
            <div class="col-2">col 2/3</div>
            <div class="col-2">col 3/3</div>
        </div>
    </div>
  6. 詳情:http://bootstrap.hexschool.com/docs/4.0/layout/grid/#%E6%B0%B4%E5%B9%B3%E5%B0%8D%E9%BD%8A
  7. 範例:

    See the Pen 水平對齊 by Tad (@tad0616) on CodePen.


:::

書籍目錄

展開 | 闔起

快速登入


https%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D939%26tbsn%3D32

計數器

今天: 6621662166216621
昨天: 2489248924892489
總計: 8028603802860380286038028603802860380286038028603