Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CSS to Image Resize  based on screen resolution

Posted on 2014-11-24
4
Medium Priority
?
244 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 2000 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 2

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 2000 total points
ID: 40467065
Show some code or an example page link
0
 
LVL 2

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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)

971 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