Set width and height to auto in HTML and CSS

Description

The following code shows how to set width and height to auto.

Example


<!--from  w w w.j  a  v  a2  s.c  o m-->




<html>
<head>

<style type='text/css'>
p {
border: thin solid black;
width: auto;
height: auto;
}
</style>
</head>
<body>
<p>
How much wood would a woodchuck chuck if a wooodchuck could chuck wood?
A woodchuck would chuck all the wood a woodchuck could chuck if a woodchuck
could chuck wood.
</p>
</body>
</html>

Click to view the demo

The code above generates the following result.

Set width and height to auto in HTML and CSS