Solved

What am I doing wrong with this graphic?

Posted on 2013-12-16
2
127 Views
Last Modified: 2013-12-20
Head out to http://www.countryshowdown.com/app/NewsDisplay.php?id=514. I need the top image to resize with the dimension of the screen. Right now, on a mobile device, while the width works as far as it not bleeding beyond the perimeter of the screen, it looks like what I've got attached.

How can I manipulate the height via css so the "max-width" setting doesn't result in something that's been stretched?
photo-9.PNG
0
Comment
Question by:brucegust
2 Comments
 
LVL 8

Accepted Solution

by:
Adrian Crabtree earned 250 total points
ID: 39722838
You can set the width and height 100% and set a max width. In this case it would be 600px;

width: 100%;
height: 100%;
max-width: 600px;

Open in new window

0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 250 total points
ID: 39723151
Bruce, while acrab's solution does work in that it resizes the image, it may not be readable or degrade as it sizes.  You might consider using media queries https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries and use different images for different viewports.

@media (max-width: 300px) {
    img.header_image_small{display:inline}
    img.header_image_large {diplay:none}
 }
@media (min-width: 300px) {
    img.header_image_small{display:none}
    img.header_image_large {diplay:inline}
 }

<img class="header_image_small" src="https://www.countryshowdown.com/images/national_final_billboard_2013_small.jpg">
<img class="header_image_large" src="https://www.countryshowdown.com/images/national_final_billboard_2013_large.jpg">

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
Show tab when enter div and change underline color 3 92
CSS style formatting? 2 35
How can I make a div layout like the one in the image 2 44
.CSS HTML Help 3 27
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

733 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