skip to Main Content

I want to keep the size of my images in my slider but i would also like to reduce the large space between my slider and my menu bar. This is being a real tool and i would appreciate it if someone guided me in the right direction. My slider leaves a huge gap between itself and the menu bar. Do i resize the image in photoshop and then place it in the slider or is there any other way around this?

Here is a Demo

Here is my css

  div#slider { 
  overflow: hidden;
  min-height: 100px;
  line-height: 100px;
   margin: 25px auto -52px;

   }
        div#slider figure img { 
        width: 20%; 
        float: left;
        margin: 25px auto -52px; 
         }
  `            
        @-webkit-keyframes slidy {
        0% { left: 0%; }
        20% { left: 0%; }
        25% { left: -100%; }
        45% { left: -100%; }
        50% { left: -200%; }
        70% { left: -200%; }
        75% { left: -300%; }
        95% { left: -300%; }
        100% { left: -200%; }
         }




   div#slider figure { 
   position: relative; 
   width: 500%;
   margin: 0;
   top: 0;
   left: 0;
  -webkit-animation: 30s slidy ease-in-out infinite;
   animation: 30s slidy ease-in-out infinite;   
   margin: 25px auto -52px;
   }`div#slider figure { 
   position: relative; 
   width: 500%;
   margin: 0;
   top: 0;
   left: 0;
  -webkit-animation: 30s slidy ease-in-out infinite;
  animation: 30s slidy ease-in-out infinite; 
  margin: 25px auto -52px;
   }


#header {
  margin-right: 10px;
  margin-left: 10px;
  width: 940px;
}
#navigation {
  padding-bottom: 25px;
  margin-top: 26px;
  margin-left: -1.0416667%; 
  padding-right: 1.0416667%; 
  padding-left: 1.0416667%; 
  width: 97.9166667%; 
  background-repeat: repeat-x;
  border-bottom-color: #bfbfbf;
  border-bottom-style: double; border-bottom-width: 4px;
}
#navigation ul li {
  display: inline-block;
}
#navigation ul li a {
  height: 42px;
  line-height: 42px;
  margin-right: 15px;
  text-decoration: none;
  text-transform: uppercase;
  font-family: Arial, "Lucida Grande", Verdana, sans-serif;
  font-size: 15px;
  color: black;
}

and my HTML:

<div id="slider">
    <figure>
        <img src="images/reciepescover.jpg" alt="">
        <img src="images/history_chocolate.jpg" alt=""> 
        <img src="images/cocoa.jpg" alt="">
        <img src="images/lays.jpg" alt="">
        <img src="images/cocoa.jpg" alt="">
    </figure>
</div>
<center>
    <div id="header">
        <div id="navigation">
            <ul>
                <li><a href="index.html">Home</a></li>
                <li><a href="pages/history.html">History</a></li>
                <li><a href="pages/producers.html">Producers</a></li>
                <li><a href="pages/companies.html">Companies</a></li>
                <li><a href="pages/reciepes.html">Reciepes </a></li>
            </ul>
        </div>

2

Answers


  1. Your demo link doesn’t display the header banner image. You should fix this so it is easier to see what you are trying to do. Makes it easier to give you an answer.

    Also, just fyi, in your css, you do not need to, nor shouldn’t qualify your #id selector for the slider. div#slider.

    #slider works just fine.

    Login or Signup to reply.
  2. Edit image using Photoshop with equal height. Or it can be done in html by using eg height="500px";

      <img src="http://demosthenes.info/assets/images/ankor-wat.jpg" height="500px" alt=""> 
    

    Provide height tag for all images.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search