AnonymousUser
AnonymousUser

Reputation: 786

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?

Upvotes: 0

Views: 1051

Answers (4)

Vijay Dwivedi
Vijay Dwivedi

Reputation: 172

Directly use this in your img tag

width="30" height="30"

Upvotes: 0

Tanvi Ranga
Tanvi Ranga

Reputation: 21

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.

Upvotes: 0

umangsaa999
umangsaa999

Reputation: 1

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

Upvotes: 0

Joel Company
Joel Company

Reputation: 40

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

Upvotes: 4

Related Questions