HTML
CSS
JavaScript
<div class='container'> <div class='content'> This is a demonstration of the max-inline-size property. Resize the browser window to see how the content behaves when it reaches the maximum inline size. </div> </div>
.container { width: 100%; border: 2px solid #007BFF; padding: 20px; box-sizing: border-box; } .content { max-inline-size: 300px; background-color: #f0f8ff; padding: 10px; border: 1px solid #007BFF; margin: auto; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
// No JavaScript required for this demo
This is a demonstration of the max-inline-size property. Resize the browser window to see how the content behaves when it reaches the maximum inline size.