正在回答
3回答
小彬__
2018-06-07 18:21:06
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title >作业5</ title > < link rel = "stylesheet" type = "text/css" href = "css/作业5.css" > </ head > < body > < div class = "content" > < h2 >jQuery实现轮播图</ h2 > < div class = "box" > <!-- 图片区 --> < div class = "img1 active" ></ div > < div class = "img2" ></ div > < div class = "img3" ></ div > < div class = "img4" ></ div > < div class = "img5" ></ div > <!-- 左右图标 --> < a href = "javascript:void(0)" class = "but pre1" ></ a > < a href = "javascript:void(0)" class = "but pre2" ></ a > </ div > <!-- 圆点 --> < div class = "dots" > < span class = "active" ></ span > < span ></ span > < span ></ span > < span ></ span > < span ></ span > </ div > <!-- </div> --> <!-- box的</div>放这个位置,不知为什么小球显示不了? --> </ div > <!-- jQuery代码 --> < script src = "https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js" ></ script > < script type = "text/javascript" > </ script > </ body > </ html > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | *{ margin : 0 ; padding : 0 ; } .content{ width : 1250px ; height : 635px ; text-align : center ; border : 1px solid white ; /*删除border圆点会偏移,所以颜色设置为白。 原因不知为何*/ margin : 0 auto ; position : relative ; } .content h 2 { margin : 50px auto ; } .box{ width : 1220px ; height : 480px ; background : #bbb ; margin : 0 auto ; position : relative ; overflow : hidden ; } .box div{ width : 1200px ; height : 460px ; background-repeat : no-repeat ; position : absolute ; left : 10px ; top : 10px ; display : none ; } .img 1 { background-image : url (../images/ 1 .jpg); } .img 2 { background-image : url (../images/ 2 .jpg); } .img 3 { background-image : url (../images/ 3 .jpg); } .img 4 { background-image : url (../images/ 4 .jpg); } .img 5 { background-image : url (../images/ 5 .jpg); } .box .active{ display : block ; } .but{ display : inline- block ; height : 80px ; width : 40px ; position : absolute ; left : 10px ; top : 200px ; } .pre 2 { background : url (../images/ pre .png) center center no-repeat ; left : auto ; right : 10px ; } .pre 1 { background : url (../images/pre 2 .png) center center no-repeat ; } .but:hover{ background-color : #333 ; opacity: 0.5 ; filter:alpha(opacity= 50 ); } .dots{ position : absolute ; /*right: 0; bottom: 24px;*/ right : 32px ; bottom : 55px ; text-align : right ; } .dots span{ display : inline- block ; width : 12px ; height : 12px ; border-radius: 50% ; background : rgba( 7 , 17 , 27 , 0.4 ); box-shadow: 0 0 0 2px rgba( 255 , 255 , 255 , 0.8 ) inset ; margin-right : 5px ; cursor : pointer ; } .dots span.active{ box-shadow: 0 0 0 2px rgba( 7 , 17 , 27 , 0.4 ) inset ; background : #fff ; } |
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧