我想将图像的大小保留在滑块中,但我也想减小滑块和菜单栏之间的较大空间。这是一个真正的工具,如果有人向正确的方向指导我,我将不胜感激。我的滑块在自身和菜单栏之间留下了巨大的空白。我是否要在Photoshop中调整图像的大小,然后将其放置在滑块中,还是有其他解决方法?
这是一个演示
这是我的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;
}
和我的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>
使用高度相等的Photoshop编辑图像。或者可以通过使用例如html来完成height="500px";
<img src="http://demosthenes.info/assets/images/ankor-wat.jpg" height="500px" alt="">
height
为所有图像提供标签。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句