Make this image 300px wide without changing the current code

<img src = '1.jpg' style = 'width:480px! important'/>
Copy the code

1. The CSS method

<img src = '1.jpg' style = 'width:480px! important; max-width:300px'>
<img src = '1.jpg' style = 'width:480px! important; The transform: scale (0.625, 1) '>
<img src = '1.jpg' style = 'width:480px! important; width:300px! important'>
Copy the code

2. Js method

document.getElementsByTagName('img') [0].setAttribute('style'.'width:300px! important; ')
Copy the code