Demo : https://www.lenlop123.com/2020/09/14-width-height.html
<style>
div.d1 {
border: 2px solid red;
width: 100px;
height: 80px;
}
div.d2 {
border: 5px solid green;
width: 100%;
height: 90px;
}
p.first {
border: 5px solid green;
min-height: 100px;
}
p.second {
border: 5px solid green;
max-width: 100px;
}
</style>
<div class="d1">This is a box with 100px width and 80px height.</div>
<div class="d2">width is <strong>100%</strong> and height is <strong>100px</strong></div>
<p class="first"> <strong>minimum height </strong> of this paragraph is set to 100px.</p>
<p class="second"><strong> maximum width </strong> of this paragraph is set to 100px.</p>
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd0eSUSpS40ffhKKDmGjW2eT5pID_3jdOS2qOFbQd1X92u7RVCcz52IN42u3Ld9lJAJue9wF0QAhysdw8TmvE8zi_jjBe8QzsWe-tRPh0D5jvQGB7skO7_2Vsg3QX7177AIJjDzvSRbjlpTMcsDKq9pFo1sFKnKaj8bb--zONEAe4MZCeInywnNGy0/s16000/a2.png)
0 Nhận xét