Solved

CSS to Image Resize  based on screen resolution

Posted on 2014-11-24
4
150 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:BobCSD
  • 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:BobCSD
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:BobCSD
ID: 40477868
This is a weekend warrior project, so I'll get back to it on the weekend hopefully. thanks!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

747 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

12 Experts available now in Live!

Get 1:1 Help Now