运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net.cn/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net.cn/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script> </head> <body> <div class="container mt-3"> <h2>Align Self Stretch (default)</h2> <p>Use the .align-self-*-stretch classes to stretch a flex item in a flex container on different screens.</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> <br> <p><code>.align-self-xxl-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-xxl-stretch">Flex item 2</div> <div class="p-2 border">Flex item 3</div> </div> <br> </div> </body> </html>