Solved

Css width/height  problem

Posted on 2014-11-17
4
95 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
[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
  • 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

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.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

730 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