CSS min-width property

CSS min-width Property

Description

The min-width property sets the bottom width of an element.

Possible Values

  • length − Any length unit. The width of the element cannot be less than this distance.
  • percentage − Constrains the element’s width to at least this percentage of the container block’s width.


Applies to

All HTML elements except non-replaced inline elements and table elements.

DOM Syntax

object.style.minWidth = "50px" 

Example

Here is an example –

<html> 
<head> 
</head> 

<body> 
<p style = "min-width:400px; height:100px; border:1px solid red; padding:5px; margin:10px;"> 
This paragraph is 100px high and min width is 400px 
This paragraph is 100px high and min width is 400px 
This paragraph is 100px high and min width is 400px 
This paragraph is 100px high and min width is 400px 
This paragraph is 100px high and min width is 400px 
</p> 

<img alt = "logo" src = "/css/https://coder-cafe.com/wp-content/uploads/2025/09/images/https://coder-cafe.com/wp-content/uploads/2025/09/logo.png" width = "95" height = "84" /> </body> 
</html> 

will produce the following results−

CSS min-width property

Leave a Reply

Your email address will not be published. Required fields are marked *