Solved

CSS to Image Resize  based on screen resolution

Posted on 2014-11-24
4
154 Views
Last Modified: 2014-12-24
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.
0
Comment
Question by:Starr Duskk
  • 2
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40464608
Not following you. If an image is set to 100% width then it will be 100% of the container.
0
 
LVL 1

Author Comment

by:Starr Duskk
ID: 40466107
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.
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 500 total points
ID: 40467065
Show some code or an example page link
0
 
LVL 1

Author Comment

by:Starr Duskk
ID: 40477868
This is a weekend warrior project, so I'll get back to it on the weekend hopefully. thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now