Setting Minimum width
You can use the min-width property to set minimum width.
- auto
- <length>
- <%>
auto is to let the browser do the calculation.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
<style type="text/css">
p {
background: lightgray;
border: 4px solid black;
margin: 2px;
box-sizing: border-box;
min-width: 100px;
width:50%;
max-width: 200px;
}
</style>
</head>
<body>
<p>
HyperText Markup Language (HTML) is the main markup language for
displaying web pages and other information that can be displayed
in a web browser(From From Wikipedia, the free encyclopedia).
</p>
</body>
</html>
Home
HTML CSS Book
CSS
HTML CSS Book
CSS
Size:
- Controlling the Size of an Element
- Setting Minimum height
- Setting Minimum width
- Setting Maximum width
- Setting Maximum height
- Setting the Sized Box
Related: