需要掌握以下要点知识的基础人员:
掌握html基本元素基础知识
掌握css布局基础知识
js运动基础知识
本实例很简单,重在考研大家的功底
样式css
*{
padding: 0;
margin: 0;
}
li{
list-style: none;
}
img{
border:0;
}
/* 控制 */
.control{
border-bottom: 1px solid #ccc;
background-color: #eee;
text-align: center;
padding: 20px 0; /* 上下距离20px 左右0 */
}
#showmsg{
font-size: 25px;
}
.roll{
width: 880px;
height: 108px;
margin: 50px auto;
position: relative;
}
.roll ul{
position: absolute;
top: 0;
left: 0;
}
.roll li{
float: left;
width: 182px;
height: 108px;
}
.roll li a:hover{
position: relative;
top: 2px;
}
.roll .wrap{
width: 728px;
height: 108px;
position: relative;
margin: 0 auto;
overflow: hidden;
}
/* 左按钮 */
.btn_left{
display: block;
width: 68px;
height: 68px;
background: url(../images/btn.jpg) no-repeat -70px -69px ;
position: absolute;/* //绝对定位会脱标 不会占据位置 */
top: 20px;
left: 1px;
z-index: 1;
}
.btn_left:hover{
background-position: -70px 0;
}
.btn_right{
width: 68px;
height: 68px;
background: url(../images/btn.jpg) no-repeat 1px -69px;
position: absolute;
right: 1px;
top: 20px;
z-index: 1;
}
.btn_right:hover{
background-position: 1px 0;
}
js文件配置,实现交互动画效果