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
Solved

Css width/height  problem

Posted on 2014-11-17
4
94 Views
Last Modified: 2014-11-18
Here's my jsfiddle:
http://jsfiddle.net/a807gemg/

I want the image to automatically adjust to the width of the green box.
I want the green box to load at whatever height will accommodate the tallest picture.

How do I do this keeping in mind I'd like a responsive design.
0
Comment
Question by:jeff_zucker
  • 2
  • 2
4 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40448872
Not entirely sure what you are trying to achieve - some rejigging of your css

http://jsfiddle.net/a807gemg/2/

*{
    box-sizing: border-box;
}
#coverslide >div {
    padding: 10px;
    width:100%;
    background-color:purple;
    height:auto;
}
#coverslide {
    height:auto;
    width:100%;
}
#coverslide img{
    width:100%
}

.green_box {
    height:auto;
    width: 400px;
    background-color:green;
    padding:0 20px;
}

Open in new window

0
 

Author Comment

by:jeff_zucker
ID: 40450071
That fixed the width problem, but now the slideshow itself is acting a little weird.  It pushes the old picture down (showing both pictures for a fraction of a second) before removing it and only showing the new picture being cycled in.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40450372
0
 

Author Closing Comment

by:jeff_zucker
ID: 40450448
Thank you.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Pure CSS popout image menu - want the most beautiful style. 7 55
How to deal with the query string 8 37
Ahax pagination 9 33
GET error with Font Awesome 3 16
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
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 …

837 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