123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- * {
- margin: 0;
- padding: 0;
- list-style: none;
- text-decoration: none;
- box-sizing: border-box;
- }
- #container {
- width: 590px;
- height: 470px;
- margin: 100px auto;
- overflow: hidden;
- position: relative;
- }
- #imgBox {
- width: 2950px;
- height: 470px;
- /* 过渡效果的css3样式属性
- 符合输出
- property 规定以什么方式去过渡
- duration 运动的时间(s/ms)
- timing-function 运动的方式
- linear 匀速
- delay 运动何时开始
- */
- /* transition: property duration timing-function delay; */
- position: absolute;
- left: 0;
- transition: left 2s linear;
- }
- /* 解决行内块元素空白间隙问题
- 1.让所有行内块元素中间无空格
- 2.float 浮动
- */
- #imgBox img {
- float: left;
- }
- .list {
- overflow: hidden;
- position: absolute;
- bottom: 10px;
- right: 10px;
- }
- .list li {
- float: left;
- width: 20px;
- height: 20px;
- background: purple;
- color: #fff;
- border-radius: 50%;
- text-align: center;
- line-height: 20px;
- font-size: 14px;
- margin-left: 10px;
- }
- #prev,#next {
- width: 50px;
- height: 50px;
- background: rgb(0, 42, 255);
- color: #66e21f;
- font-size: 30px;
- text-align: center;
- line-height: 50px;
- position: absolute;
- top: 50%;
- margin-top: -25px;
- }
- #prev {
- left: 0;
- }
- #next {
- right: 0;
- }
- .list .selected {
- background: #f00;
- color: #ff0;
- }
- </style>
- </head>
- <body>
- <div id="container">
- <div id="imgBox">
- <img src="../image/1.jpg" alt="">
- <img src="../image/2.jpg" alt="">
- <img src="../image/3.jpg" alt="">
- <img src="../image/4.jpg" alt="">
- <img src="../image/5.jpg" alt="">
- </div>
- <ul class="list">
- <li class="selected">1</li>
- <li>2</li>
- <li>3</li>
- <li>4</li>
- <li>5</li>
- </ul>
- <div id="prev">
- <span><</span>
- </div>
- <div id="next">
- <span>></span>
- </div>
- </div>
- <script src="../js/6.滑入轮播图.js"></script>
- </body>
- </html>
|