Solved

CSS to Image Resize  based on screen resolution

Posted on 2014-11-24
4
169 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 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

831 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