Avatar of Starr Duskk
Starr Duskk
Flag for United States of America asked on

CSS to Image Resize based on screen resolution

I want to resize an image based on the screen resolution. For instance, if a user resizes their browser, or it is a mobile device, etc.

I can do it with this style on the IMG tag:
.ProfileImage {
    min-width: 100%;
    height: auto;
}

Open in new window


And put a max-width on a panel (div) box around the image. But that ONLY resizes the image if my starting width is larger than the image itself. Then it resizes the image to the actual width of the image as I drag the browser smaller.

I want to shrink the image as the page gets smaller, even if the image is large to begin with.

How do I do that? I am using asp.net as well, if that helps to make this happen.

thanks.
CSSASP.NETHTML

Avatar of undefined
Last Comment
Starr Duskk

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gary

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Starr Duskk

ASKER
When you drag the screen size to make it smaller, I want the image to be made smaller. the container is 50% of the size of the screen, so as the screen size is made smaller, the container is made smaller. But the image stays big.
SOLUTION
Gary

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Starr Duskk

ASKER
This is a weekend warrior project, so I'll get back to it on the weekend hopefully. thanks!
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy