<!DOCTYPE html>
<html>
<head>
<style>
#div1, #div2{
height: 100px;
margin: 5px;
border: solid black 3px;
display: inline-block;
}
#div1{
max-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% {inline-size: 250px;}
}
</style>
</head>
<body>
<h1>Max-inline-size and inline-size comparison</h1>
<p>The content gradually changes size in the same way inside both boxes, but the effects from max-inline-size and inline-size are different. The box with max-inline-size is able to shrink along with its shrinking content:<p>
<div id="div1">
<p class="content">Div element with max-inline-size 100px;</p>
</div>