在不改变当前代码的情况下,使这张图片的宽度为300px?
<img src="1.jpg" style="width:480px!important"/>
1.css方法
html
<img src="1.jpg" style="width:480px!important; max-width: 300px">
<img src="1.jpg" style="width:480px!important; transform: scale(0.625, 1);" >
<img src="1.jpg" style="width:480px!important; width:300px!important;">
2.js方法
JavaScript
document.getElementsByTagName("img")[0].setAttribute("style","width:300px!important;")