我想實現一個jQuery圖像幻燈片到我的網站,因爲我沒有自己創建它,我無法識別所有的CSS屬性。我遇到的三個問題是:執行jQuery照片幻燈片時出現問題
1)當圖像滾動時,會有一個父容器伸展到幻燈片面板的寬度之外。 2)我調整了每個屬性的邊距和填充,但是我無法讓圖像周圍的黑色填充消失。 3)我想不出如何調整圖像之間的空間。
在這裏你可以看到黑色填充圖像周圍:
在這裏,你可以看到的圖像之間以及圖像浮在容器外兩種保證金:
帶放大鏡的酒吧是我的IDE的一部分。
因此,這裏是正在運行的滑塊的HTML:
<div class="slider">
<div id="header">
<div class="wrap">
<div id="slide-holder">
<div id="slide-runner">
<a href=""><img id="slide-img-1" src="images/nature-photo.png" class="slide" alt="" /></a>
<a href=""><img id="slide-img-2" src="images/nature-photo1.png" class="slide" alt="" /></a>
<a href=""><img id="slide-img-3" src="images/nature-photo2.png" class="slide" alt="" /></a>
<a href=""><img id="slide-img-4" src="images/nature-photo3.png" class="slide" alt="" /></a>
<a href=""><img id="slide-img-5" src="images/nature-photo4.png" class="slide" alt="" /></a>
<a href=""><img id="slide-img-6" src="images/nature-photo4.png" class="slide" alt="" /></a>
<a href=""><img id="slide-img-7" src="images/nature-photo6.png" class="slide" alt="" /></a>
<div id="slide-controls">
<p id="slide-client" class="text"><strong>post: </strong><span></span></p>
<p id="slide-desc" class="text"></p>
<p id="slide-nav"></p>
</div>
</div>
</div>
<script type="text/javascript">
if(!window.slider) var slider={};slider.data=[
{"id":"slide-img-1","client":"nature beauty","desc":"nature beauty photography"},
{"id":"slide-img-2","client":"nature beauty","desc":"add your description here"},
{"id":"slide-img-3","client":"nature beauty","desc":"add your description here"},
{"id":"slide-img-4","client":"nature beauty","desc":"add your description here"},
{"id":"slide-img-5","client":"nature beauty","desc":"add your description here"},
{"id":"slide-img-6","client":"nature beauty","desc":"add your description here"},
{"id":"slide-img-7","client":"nature beauty","desc":"add your description here"}
];
</script>
</div>
</div>
</div>
這裏是CSS:
* {
margin : 0;
padding : 0;
}
html {
height : 100%;
}
div.slider {
height : 100%;
color : #a4a4a4;
cursor : default;
font-size : 11px;
line-height : 16px;
text-align : center;
background-position : 50% 0;
background-repeat : no-repeat;
font-family : Tahoma, sans-serif;
background-color: black;
}
a:link, a:visited {
color : #fff;
text-decoration : none;
}
a img {
width: 92%;
}
div.wrap {
text-align : left;
}
div#top div#nav {
float : left;
clear : both;
width : 993px;
height : 52px;
}
div#top div#nav ul {
float : left;
width : 700px;
height : 52px;
list-style-type : none;
}
div#nav ul li {
float : left;
height : 52px;
}
div#nav ul li a {
border : 0;
height : 52px;
display : block;
line-height : 52px;
text-indent : -9999px;
}
div#header {
margin : -1px 0 0;
}
div#video-header {
height : 683px;
margin : -1px 0 0;
}
div#header div.wrap {
/* image height */
height : 300px;
background : url(images/header-bg.png) no-repeat 50% 0;
}
div#header div#slide-holder {
/* slider container */
z-index : 40;
width : 915px;
height : 299px;
position : absolute;
}
div#header div#slide-holder div#slide-runner {
top : 9px;
left : 9px;
width : 973px;
height : 278px;
overflow : hidden;
position : absolute;
}
div#header div#slide-holder img {
margin : 0;
display : none;
position : absolute;
}
div#header div#slide-holder div#slide-controls {
left : 0;
top: 0;
width : inherit;
height : 46px;
width: 896px;
display : none;
position : absolute;
background-color: rgba(0,0,0, .5);
}
div#header div#slide-holder div#slide-controls p.text {
float : left;
color : #fff;
display : inline;
font-size : 10px;
line-height : 16px;
margin-top: 13px;
}
div#header div#slide-holder div#slide-controls p#slide-nav {
/* page numbers */
float : right;
height : 24px;
display : inline;
margin : 11px 15px 0 0;
}
div#header div#slide-holder div#slide-controls p#slide-nav a {
float : left;
width : 24px;
height : 24px;
display : inline;
font-size : 11px;
margin : 0 5px 0 0;
line-height : 24px;
font-weight : bold;
text-align : center;
text-decoration : none;
background-position : 0 0;
background-repeat : no-repeat;
}
div#header div#slide-holder div#slide-controls p#slide-nav a.on {
background-position : 0 -24px;
}
div#header div#slide-holder div#slide-controls p#slide-nav a {
background-image : url(images/slide-nav.png);
}
div#nav ul li a {
background : url(images/nav-bg.png) no-repeat;
}
我知道它可能很難僅僅通過看標記看到,但沒有人敏銳的眼光看CSS會發現問題嗎?