Wednesday, 19 July 2017

Setting Box Dimensions in CSS

The min-width, max-width, min-height, and max-height properties are used to set the dimensions of box. Now create a Web pages, named boxdimensions.html to implement these properties.

<!doctype html>
<head>
<style type="text/css">
p{
min-width:10px;
min-height:10px;
max-width:20em;
max-height:20em;
border:1em #999 inset;}
</style>
</head>
<body>
<p>
set box dimension set box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimensionset box dimension
</p>
</body>
</html>

The min-width, min-height, max-width and max-height are used to set the dimension of p element.

The output of the above document is:



No comments:

Post a Comment