Solved

What am I doing wrong with this graphic?

Posted on 2013-12-16
2
128 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 53

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

Technology Partners: 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

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…

688 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