我有一个 div,其中包含自动垂直滑动的图像。现在根据我的要求,我需要将此 div 定位到屏幕中心,距离顶部 78px
的高度,但我做不到。这是我的 HTML..
<div id="slideshow-carousel">
<ul id="carousel" class="jcarousel jcarousel-skin-tango">
<li><a href="#" rel="p1"><img src="images/1.jpg" width="960" height="583" alt="#"/></a></li>
<li><a href="#" rel="p2"><img src="images/2.jpg" width="960" height="583" alt="#"/></a></li>
<li><a href="#" rel="p3"><img src="images/3.jpg" width="960" height="583" alt="#"/></a></li>
<li><a href="#" rel="p4"><img src="images/4.gif" width="960" height="583" alt="#"/></a></li>
<li><a href="#" rel="p5"><img src="images/5.gif" width="960" height="583" alt="#"/></a></li>
<li><a href="#" rel="p6"><img src="images/6.gif" width="960" height="583" alt="#"/></a></li>
<li><a href="#" rel="p7"><img src="images/7.gif" width="960" height="583" alt="#"/></a></li>
</ul>
</div>
这是我尝试添加的 CSS..
<div id="slideshow-carousel" style="position:absolute;margin-top: 78px;align:center">
CSS..
#slideshow-carousel {
float:left;
width:960px;
position:relative
}
#slideshow-carousel ul {
margin:0;
padding:0;
list-style:none;
}
#slideshow-carousel li {
background:#fff;
height:583px;
position:relative
}
#slideshow-carousel li .arrow {
left:3px;
top:28px;
position:absolute;
width:20px;
height:40px;
background:url(images/arrow_white.png) no-repeat 0 0;
display:block;
}
#slideshow-carousel li a {
background:#000;
display:block;
width:960px;
height:583px;
}
请帮帮我..
编写一个 css 类,并将其应用于您的 div。根据需要设置边距,或保持自动。
.center
{
margin-left:auto;
margin-right:auto;
width:70%;
background-color:#b0e0e6;
}
我是一名优秀的程序员,十分优秀!