How Do We Set the Maximum width as 100% of an image file?

It is a Webmaster forum to discuss website promotion, CMS management, Search Engine discussions, AdSense, etc.
Post Reply
Anish
Standard User
Posts: 21
Joined: 25 Dec 2023, 14:06

How Do We Set the Maximum width as 100% of an image file?

Post by Anish »

I am making one of my websites into a responsive website. Everything works fine except for some image files. I am struggling to fit those images into mobile screens. Is there any method to command those image files to fit into 100% on a mobile screen?
Yashika
Standard User
Posts: 48
Joined: 16 Oct 2023, 11:29
Location: Noida Sector 85

Re: How Do We Set the Maximum width as 100% of an image file?

Post by Yashika »

You should style the image like it.

Code: Select all

style="width:100%;height:auto;"
Your image will show 100 percent on all screens.
Anish
Standard User
Posts: 21
Joined: 25 Dec 2023, 14:06

Fix: How Do We Set the Maximum width as 100% of an image file?

Post by Anish »

Thank you Yashika. It worked.
Post Reply