<div class="container">
<div class="element element-1">
I have a minimum width of 450px. Even if my <code>width</code> is set to less than 450px, it will not have any effect since it will be overridden by the <code>min-width</code> value.
<div class="child">
I have the same minimum width as my parent.
</div>
</div>
<div class="element element-2">
I will always have a minimum width which is equal to 3em.
</div>
</div>
body {
background-color: #F5F5F5;
color: #555;
font-size: 1.1em;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
.container {
margin: 40px auto;
max-width: 700px;
}
.element {
padding: 20px;
background-color: #0099cc;
color: white;
margin-bottom: 150px;
}
.element-1 {
height: 200px;
min-width: 450px;
}
.child {
background-color: salmon;
padding: 30px;
margin: 20px;
min-height: inherit;
}
.element-2 {
min-width: 3em;
}