运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <head> <style> #div1, #div2{ height: 50px; margin: 5px; display: inline-block; border: solid black 3px; } #div1{ min-inline-size: 200px; } #div2{ inline-size: 200px; } p.content{ margin: 0; background-color: lightgreen; height: 100%; width: 150px; animation: mymove 5s infinite; } @keyframes mymove { 50% {width: 250px;} } </style> </head> <body> <h1>Min-inline-size and inline-size comparison</h1> <p>Content gradually changes size in the same way inside both boxes, but the effects from min-inline-size and inline-size are different. The box with min-inline-size is able to expand past 200px to contain its growing content:<p> <div id="div1"> <p class="content">Div element with min-inline-size 200px;</p> </div> <br> <div id="div2"> <p class="content">Div element with inline-size 200px;</p> </div> </body> </html>