还有好多问题,请老师指导怎么改进。
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 | <!DOCTYPE html> < html > < head > < meta charset = "utf-8" > < title ></ title > < style type = "text/css" > *{padding:0;margin:0;color:#fff;font-size: 16px;} .header{width:100%;min-width: 800px;height: 100px;background:#000;color:#fff;text-align: center;line-height: 100px;position: fixed;top:0px;} .logo{float:left;width:30%;} .header_navi{float:right; width:30%;min-width: 300px;} .header_navi ul{list-style-type:none;} .header_navi ul li{display:inline-block;padding:10px; color:#fff;} .header_navi ul li a{text-decoration: none;color:#fff;} .container{width:100%;min-width:800px;font-size: 0px;margin:100px auto;} .container img{width:100%;margin:0;} .footer{width:100%;height:100px;background: black;position:fixed;bottom: 0;align-items: center;} .footer ul{list-style-type: none; width:500px; margin:0 auto;} .footer ul li{float:left; text-align:center;width:100px;height: 100px;line-height: 100px;} .footer ul li a{text-decoration: none;} </ style > </ head > < body > <!-- Header Section --> < div class = "header" > < div class = "logo" > < a href = "#" >< img src = "http://img1.sycdn.imooc.com/climg//58c0d2d900016ce303000100.png" alt = "" ></ a > </ div > < div class = "header_navi" > < 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 > <!-- Page Container --> < div class = "container" > < img src = "http://img1.sycdn.imooc.com/climg//58c0eda50001e12416000480.jpg" /> < img src = "http://img1.sycdn.imooc.com/climg//58c0edb80001c9f216000480.jpg" /> < img src = "http://img1.sycdn.imooc.com/climg//58c0edc9000100d516000480.jpg" /> </ div > < div class = "footer" > < 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 > </ body > </ html > |
9
收起
正在回答
1回答
顶部右侧导航没有垂直居中,建议左右距离使用paddin:0 10px;垂直居中使用line-height
1 2 3 4 5 6 7 | .header_navi ul li { display : inline- block ; /*padding: 10px;*/ line-height : 100px ; padding : 0 10px ; color : #fff ; } |
除了顶部右侧的导航没有实现垂直居中意外,其他的实现的很好,继续加油~
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧