Set width and height to auto
Description
The following code shows how to set width and height to auto.
Example
<html>
<head>
<style type='text/css'>
p {<!-- w w w.ja v a2 s . co m-->
padding: 10px;
margin: 10px;
border: thin solid black;
width: auto;
min-width: 200px;
}
img#x-aspect-1 {
border: 1px solid black;
margin: 5px;
width: 200px;
height: auto;
}
</style>
</head>
<body>
<p>This is a test. This is a test.</p>
<img src='http://www.java2s.com/style/download.png' id='x-aspect-1' />
</body>
</html>