简体   繁体   中英

Image size issue, width and height not working

This is the style: style="width:30px;height:30px; which I tried and other CSS to an image, but stays original size?

Maybe the image size is being overridden somewhere else. To counter this,

style="width: 30px;important:height; 30px !important;"

The !important specifies that the property given should override any other class property or image property

Try to write the code in body instead of style and see does it works or not.

There is a possibility that your CSS might be getting overridden with any other CSS, to deliberate your CSS you can use !important For ex

style="width: 30px !important;height: 30px !important;"  

It would be better if you share your html and css code for this issue.

Directly use this in your img tag

width="30" height="30"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM