Toggle navigation
☰
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <style> .min-container { background-color: #e9ecef; border: 1px dashed #adb5bd; padding: 20px 10px; display: flex; justify-content: center; border-radius: 8px; } .min-box { background-color: #d63384; color: #fff; font-family: sans-serif; font-weight: bold; text-align: center; padding: 30px 20px; border-radius: 8px; box-sizing: border-box; /* The box will take up 100% of the container's width. However, if 100% becomes greater than 600px, it will stop growing and stay capped at exactly 600px. */ width: min(100%, 600px); } </style> <div class="min-container"> <div class="min-box"> width: min(100%, 600px) </div> </div>