Home
HTML
HTML Images
Example 10: HTML Images
Run ❯❯
<!DOCTYPE html> <html> <head> <title>HTML Image Size Override Example</title> <style> img { width: 100%; } </style> </head> <body> <h1>HTML Image Size Override Example</h1> <p>The size of the below image has been set using the width and height attributes. Width is set to 200 px but the internal CSS written in head section overrides the width to 100%.</p> <img src="chromelogo.png" alt="Chrome Logo" width="200" height="200"> <p>The size of the below image has been set using the style property. Width is set to 200 px. Here the internal CSS written in head section does not overrides the width.</p> <img src="chromelogo.png" alt="Chrome Logo" style="width:200px; height:200px;"> </body> </html>