2-9作业 footer页脚怎么固定就会消失掉。
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 | <!DOCTYPE html> 为什么我在footer内加position:fixed.这部分就消失了。 < html > < head > < meta charset = "UTF-8" > < title ></ title > < style type = "text/css" > /*此处写代码*/ *{margin: 0; padding: 0;} body{text-align: center; font-size: 16px; color: red;border: 1px solid green;} .header{width: 100%; height: 100px; background: url(http://img1.sycdn.imooc.com/climg//58c0d2d900016ce303000100.png) no-repeat; background-color: #000; position: fixed; } .header > dl > dd{ float: right; line-height: 100px; width: 76px;} .header > dl > dd a {text-decoration: none; color: #FFF;} .header > dl{margin:0 250px;} .c{clear: both;} /* content */ .content{width: 100%; padding-top: 100px;} .content > div > img{ width: 100% ; height: 480px; } /* footer */ .footer{ width: 100%; height: 100px; background-color: #000; /*position: fixed;*/ } .footer > dl > dd a {text-decoration: none; color: #FFF;} .footer > dl > dd{ float: left; line-height: 100px; width: 136px;} .footer > dl{margin:0 250px;} </ style > </ head > < body > <!-- 此处写代码 --> <!--- 头部 --> < div class = "header" > < dl > < dd >< a href = "#" >频道</ a ></ dd > < dd >< a href = "#" >职业规划</ a ></ dd > < dd >< a href = "#" >实战</ a ></ dd > < dd >< a href = "#" >猿问</ a ></ dd > < dd >< a href = "#" >手记</ a ></ dd > </ dl > < div class = "c" ></ div > </ div > < div class = "c" ></ div > <!-- content --> < div class = "content" > < div >< img src = "http://img1.sycdn.imooc.com/climg//58c0eda50001e12416000480.jpg) no-repeat" ></ div > < div >< img src = "http://img1.sycdn.imooc.com/climg//58c0edb80001c9f216000480.jpg) no-repeat" ></ div > < div >< img src = "http://img1.sycdn.imooc.com/climg//58c0edc9000100d516000480.jpg) no-repeat" ></ div > </ div > <!-- footer --> < div class = "footer" > < dl > < dd >< a href = "#" >网站首页</ a ></ dd > < dd >< a href = "#" >企业合作</ a ></ dd > < dd >< a href = "#" >人才招聘</ a ></ dd > < dd >< a href = "#" >联系我们</ a ></ dd > < dd >< a href = "#" >常见问题</ a ></ dd > < dd >< a href = "#" >友情链接</ a ></ dd > </ dl > </ div > </ body > </ html > |
18
收起
正在回答 回答被采纳积分+1
2回答
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧