上一节作业,怎么才能做到响应式?求批改
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title ></ title > < style type = "text/css" > /*此处写代码*/ body, div, ul, li ,img{ padding: 0; margin: 0; font-size: 24px; font-family: 'Microsoft Yahei'; } .container { width: 100%; height: 100px; background: #000; position: fixed; top:0; left:0; /*position: absolute; top: 50%; left: 50%; margin-left: -550px; margin-top: -50px;*/ } .container img { cursor: pointer; } .nav { display: inline-block; width: 800px; height: 100px; } .nav ul { list-style-type: none; position: absolute; top: 0; right: 10px; } .nav ul li { display: inline-block; float: left; text-align: center; line-height: 100px; padding: 0 34px; cursor: pointer; } a { text-decoration: none; color: #fff; } ul li:hover { background: #14191e; } .ad { width:100%; } .ad img { width:100%; margin: 0; } .footer { width: 100%; height:100px; background: #000; text-align:center; line-height: 100px; font-size:16px; position: fixed; left: 0; bottom: 0; } .footer a { margin-left: 20px; } .footer a:nth-child(1) { margin-left: 0px; } </ style > </ head > < body > <!-- 此处写代码 --> < div class = "container" > < img src = "http://img1.sycdn.imooc.com/climg//58c0d2d900016ce303000100.png" alt = "" > < div class = "nav" > < ul > < li >< a href = "#" >课程</ a ></ li > < li >< a href = "#" >职业路径</ a ></ li > < li >< a href = "#" >实战</ a ></ li > < li >< a href = "#" >袁问</ a ></ li > < li >< a href = "#" >手记</ a ></ li > </ ul > </ div > </ div > < div class = "ad" > < img src = "http://img1.sycdn.imooc.com/climg//58c0eda50001e12416000480.jpg" alt = "" > < img src = "http://img1.sycdn.imooc.com/climg//58c0edb80001c9f216000480.jpg" alt = "" > < img src = "http://img1.sycdn.imooc.com/climg//58c0edc9000100d516000480.jpg" alt = "" > </ div > < div class = "footer" > < a href = "#" >网页首页</ a > < a href = "#" >企业合作</ a > < a href = "#" >人才招聘</ a > < a href = "#" >联系我们</ a > < a href = "#" >常见问题</ a > < a href = "#" >友情链接</ a > </ div > </ body > </ html > |
29
收起
正在回答
1回答
不需要做响应式,这里不做要求,因为响应式是一个大的学习模块,现在还没有学,所以不用做,进阶路径中会有一个步骤的周期来学习响应式,到时候好好学,学完之后就可以做响应式了。如果你现在想学的话,可以查一下@media,祝学习愉快!
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧