Problem with slideshow css

Asked

Viewed 125 times

1

I want to leave the slide with the format of the image below.
I add the display:block in my slideshow images, but it doesn’t work!

o modelo do meu slideshow

HTML:
<div class="slideshow">
  <div class="slide">

    <div class="slide-1">
     <img src="img/01.jpg">
    </div>
    <div class="slide-2">
     <img src="img/img02.jpg">
    </div>
    <div class="slide-3">
     <img src="img/img02.jpg">
    </div>

  </div>
 </div> 

CSS:

.slideshow{
    width:100%;
    max-width:980px;
    height:auto;
    margin:0 auto;
}

.slide{
    width:100%;
    height:auto;
    display:block;
}

.slide-1{
    width:75%;
    height:505px;
    float:left;
}

.slide-2{
    width:50%;
    height:250px;
    float:right;
}

.slide-3{
    width:50%;
    height:250px;
    float:right;
}
  • But after all, what do you want to do? Leave it as in the picture?

  • Yes. I want to leave the same image !

1 answer

0


Correct the slide percentage. 75% + 50% is 125%. Use float: left in all elements.

.slide-1{
    width:75%;
    height:505px;
    float:left;
}

.slide-2{
    width:25%;
    height:250px;
    float:left;
}

.slide-3{
    width:25%;
    height:250px;
    float:left;
}

» Jsfiddle

  • Friend I put everything you sent, but, the width of the imgs does not match the slide model ! If it is not bother ?

  • Look at the Jsfiddle link I put in the answer. It shows the code working. Try there. Remember that when changing the size of the images, also calculate the percentage of the Ivs. Take into account your 980px. If it is 75% the larger image should be 735px and the smaller 245px wide!

  • vlw helped me a lot !!

  • I’m still a layman in web programming !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.