An image height and width using both:-
<html>
<head>
<style>
/* This stylesheet sets the width of all images to 100%: */
img {
width: 100%;
}
</style>
</head>
<body>
<h2>Styling Images</h2>
<p>The image below has the width attribute set to 150 pixels, but the stylesheet overrides it, and sets the width to 100%.</p>
<img src="GUN.gif" alt="GUN AK47" width="150" height="150">
<p>The image below uses the style attribute, where the width is set to 150 pixels which overrides the stylesheet:</p>
<img src="GUN.gif" alt="GUN AK47" style="width:150px;height:150px;">
</body>
</html>
OUTPUT:-
<html>
<head>
<style>
/* This stylesheet sets the width of all images to 100%: */
img {
width: 100%;
}
</style>
</head>
<body>
<h2>Styling Images</h2>
<p>The image below has the width attribute set to 150 pixels, but the stylesheet overrides it, and sets the width to 100%.</p>
<img src="GUN.gif" alt="GUN AK47" width="150" height="150">
<p>The image below uses the style attribute, where the width is set to 150 pixels which overrides the stylesheet:</p>
<img src="GUN.gif" alt="GUN AK47" style="width:150px;height:150px;">
</body>
</html>
OUTPUT:-