可在CSS中利用width属性和height属性控制一个图像得到大小,就像控制其他任何盒子的大小一样。
<html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> img.large { 500px; height:500px;} img.medium { 250px; height: 250px;} img.small{ 100px; height:100px; } </style> </head> <body> <div>TODO write content</div> <img src="magnolia-large.jpg" alt="Magnolia"/> <img src="magnolia-medium.jpg" alt="Magnolia"/> <img src="magnolia-small.jpg" alt="Magnolia"/> </body> </html>