Minimun width

In this article we are going to learn about minimum width property, how we can set the minimum width of html element with a minimum width property in css to prevent the value of the width property from becoming smaller than minimum width.

We learnt about css in general, fonts, colors, background colors, borders, margin padding, float and width in css so, we will be focusing on minimun width.

Minimum width

Minimum width is a css property used to set a width limit that the element can have. The element with minimum width can not have width smaller than minimum width but can have the width larger than minimum width.

We are going to give the div element minimum width of 190px, copy and paste below code.

<div style="min-width: 190px;">This is 190px minimum width of div element.</div>


So, we should have the following results.

This is 190px minimum width of div element.

We are going to increase the minimum width and we will set it to 200px, copy and paste below code.

<div style="min-width: 200px;">This is 200px minimum width of div element.</div>


So, we should have the following results.

This is 200px minimum width of div element.

We are going to decrease the minimum width and we will set it to 100px, copy and paste below code.

<div style="min-width: 100px;">This is 100px minimum width of div element.</div>


So, we should have the following results.

This is 100px minimum width of div element.

Let us create two elements with different minimum widths of 55px and 70px, copy and paste below code.

<div style="min-width: 55px;">This is 55px minimum width of div element.</div>

<div style="min-width: 70px;">This is 70px; minimum width of div element.</div>


So, we should have the following results.

This is 55px minimum width of div element.
This is 70px minimum width of div element.

Conclusion

In this article we learnt about minimum width property with examples, how we can set the minimum width of html element with a minimum width property in css to prevent the value of the width property from becoming smaller than minimum width.