欢迎您 本站地址:
复制网址
手机查看
切换背景
源代码:
html编辑器
颜色值转换
点击运行
Bootstrap 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.staticfile.net/twitter-bootstrap/4.3.1/css/bootstrap.min.css"> <script src="https://cdn.staticfile.net/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdn.staticfile.net/popper.js/1.15.0/umd/popper.min.js"></script> <script src="https://cdn.staticfile.net/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script> <div class="container mt-3"> <h2>延展一个单独子元素(默认)</h2> <p>.align-self-*-stretch 类据不同屏幕设备,延展一个单独子元素。</p> <p><code>.align-self-stretch</code>:</p> <div class="d-flex bg-light" style="height:150px"> <div class="p-2 border">Flex item 1</div> <div class="p-2 border align-self-stretch">Flex item 2</div> <div class="p-2 border">Flex item 3</div> </div> <br> <p><code>.align-self-sm-stretch</code>:</p> <div class="d-flex bg-light" style="height:150px"> <div class="p-2 border">Flex item 1</div> <div class="p-2 border align-self-sm-stretch">Flex item 2</div> <div class="p-2 border">Flex item 3</div> </div> <br> <p><code>.align-self-md-stretch</code>:</p> <div class="d-flex bg-light" style="height:150px"> <div class="p-2 border">Flex item 1</div> <div class="p-2 border align-self-md-stretch">Flex item 2</div> <div class="p-2 border">Flex item 3</div> </div> <br> <p><code>.align-self-lg-stretch</code>:</p> <div class="d-flex bg-light" style="height:150px"> <div class="p-2 border">Flex item 1</div> <div class="p-2 border align-self-lg-stretch">Flex item 2</div> <div class="p-2 border">Flex item 3</div> </div> <br> <p><code>.align-self-xl-stretch</code>:</p> <div class="d-flex bg-light" style="height:150px"> <div class="p-2 border">Flex item 1</div> <div class="p-2 border align-self-xl-stretch">Flex item 2</div> <div class="p-2 border">Flex item 3</div> </div> <br> </div>
运行结果:
小库提示
扫描下方二维码,访问手机版。
打赏
关闭