<html>
<head>
<style>
html, body {
height: 100%;
}
img.one {
height: auto;
width: auto;
}
img.two {
height: 50%;
width: 50%;
}
</style>
</head>
<body>
<h2>Set the height and width in %</h2>
<p>Resize the browser window to see the effect.</p>
<p>Original image:</p>
<img class="one" src="ocean.jpg" width="300" height="300"><br>
<p>Sized image (in %):</p>
<img class="two" src="ocean.jpg" width="300" height="300">
</body>
<!-- Mirrored from www.w3schools.com/css/tryit.asp?filename=trycss_dim_height_percent by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:26:22 GMT -->
</html>