如何使用CSS为JQUERY内容滑块内联箭头和项目符号?

时间:2012-07-31 11:04:03

标签: html css

需要帮助调整css中的一些元素。目前有一个小内容滑块,将显示简单的列表,如新闻帖等。一切运行正常,我只需要帮助对齐箭头和分页点。我想要每个箭头中间的子弹点。

This is what it currently looks like

实时在线链接 - > http://www.garyrevell.co.uk/mrtest/index.html


这是我的HTML + CSS

 <!--START DEALS-->

 <div class="box-deals">

 <h1> Latest Deals </h1>
<hr>

    <article>

    <div id="slider1">
                                            <div class="viewport">
                        <ul class="overview">

                            <li>

                            <div class="dealimg"><img src="images/blank-logo.jpg" width="70" height="70" alt="feature-img"></div>

                            <div class="dealtitle">Deal Title Here</div>

                            <div class="deal-des">Mon - Thur, Sat only specific text here</div>

                            <p> <a href="#">Login</a> or <a href="#">signup</a> to get this deal </p>


</li>

<li>

                            <div class="dealimg"><img src="images/blank-logo.jpg" width="70" height="70" alt="feature-img"></div>

                            <div class="dealtitle">Deal Title Here</div>

                            <div class="deal-des">Mon - Thur, Sat only specific text here</div>

                            <p> <a href="#">Login</a> or <a href="#">signup</a> to get this deal </p>


</li>




                        </ul>
                    </div>

                    <a class="buttons prev" href="#">left</a>

                    <a class="buttons next" href="#">right</a>

                    <ul class="pager">
                        <li><a rel="0" href="#" class="pagenum active">1</a></li>
                        <li><a rel="1" href="#" class="pagenum">2</a></li>

                    </ul>





                </div>  


    </article>




</div><!--END DEALS-->

这是我的CSS

/* Slider-Bullets*/

#slider1 .pager { overflow:hidden; list-style: none; clear: both; margin: 0 0 0 45px; }

/*Normal Style*/

#slider1 .pager li { float: left;  display: block; 

}

#slider1 .pager a { width: 15px;
height: 15px;
background:url(../images/bullet-norm.png); background-position: left top; background-repeat:no-repeat;
float: left;
text-indent: -4000px;
position: relative;
margin-left: 3px;
color: transparent;
display:inline;
clear: left;




}

#slider1 .pager a:hover{
    background-position: 0 50%;
    width:15px;
    height:15px;
    float: left; 
    text-indent: -4000px; 
    position:relative;
    margin-left:3px;

    color:transparent;
}

/*Active Style*/

#slider1 .pager .active { color: #fff; background-image:url(../images/bullet-selected.png); } /*CURRENT IMAGE HERE*/
#slider1 .overview { list-style: none; position: absolute; width: 240px; left: 0 top: 0; }
#slider1 .overview li{ float: left; margin: 0 20px 0 0;  width: 236px;


}

/* Tiny Carousel */
#slider1 { height: 1%; overflow:hidden; padding: 0 0 10px;   }

#slider1 .viewport { float: left; width: 240px; min-height: 190px; overflow: hidden; position: relative; }

#slider1 .buttons { background:url("../images/buttons.png") no-repeat scroll 0 0 transparent; display: block; margin: 30px 10px 0 0; background-position: 0 -38px; text-indent: -999em; float: left; width: 39px; height: 37px; overflow: hidden; position: relative; }

#slider1 .previous { background-position: 0 0; margin-left:5px;  }
#slider1 .next { background-position: 0 0; left: 130px }
#slider1 .disable { visibility: hidden; }

#slider1 .overview { list-style: none; position: absolute; padding: 0; margin: 0; width: 240px; left: 0 top: 0; }
#slider1 .overview li{ float: left; margin: 0 20px 0 0; padding: 1px; height: 121px;  width: 230px;}

提前谢谢你。

加里

2 个答案:

答案 0 :(得分:0)

在您的style.css中,您需要更改以下内容:

  • 562 ,即#slider1 .buttons给出否定的top-margin,如下所示:

    margin: -10px 10px 0 0

  • 616 ,即#slider1 .pager删除clear:both

然后你的滑块会表现正常。

答案 1 :(得分:0)

<div id="test">
    <a class="buttons prev" href="#">left</a> 
    <ul class="pager">
        <li><a rel="0" href="#" class="pagenum active">1</a></li> 
        <li><a rel="1" href="#" class="pagenum">2</a></li> 
    </ul>
    <a class="buttons next" href="#">right</a> 
</div>