主页
CSS
CSS Flexbox
Flex 项目
试用:flex-shrink 属性
运行 ❯
获取你的
自己的
网站
×
更改方向
保存代码
更改主题,暗/亮
前往 Spaces
<!DOCTYPE html> <html> <head> <style> .flex-container { display: flex; align-items: stretch; background-color: #f1f1f1; } .flex-container>div { background-color: DodgerBlue; color: white; width: 100px; margin: 10px; text-align: center; line-height: 75px; font-size: 30px; } </style> </head> <body> <h1>The flex-shrink Property</h1> <p>Do not let the third flex item shrink as much as the other flex items:</p> <div class="flex-container"> <div>1</div> <div>2</div> <div style="flex-shrink: 0">3</div> <div>4</div> <div>5</div> <div>6</div> <div>7</div> <div>8</div> <div>9</div> <div>10</div> </div> </body> </html>