3-3 老师,为什么主体占屏不是100%,而且滚动时会覆盖导航栏?
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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title ></ title > < style type = "text/css" > /*此处写代码*/ *{ margin:0; padding:0; } .header,.footer{ width:100%; height:100px; background-color:#000; position:fixed; color:#fff; } .footer{ bottom:0; } .footer ul{ width: 780px; margin:0 auto; } .logo{ cursor:pointer; float:left; } .ul{ position:absolute; right:0; top:0; } ul{ list-style-type:none; } ul li{ float:left; margin:0 25px; font-size: 26px; line-height: 100px; } ul li:hover{ cursor:pointer; color:orange; } .content{ padding:100px 200px 0 220px; color: #000; margin:0 auto; min-width:900px; } .left,.middle,.right{ position:relative; float:left; min-height:500px; } .middle{ width:100%; background-color:rgb(255,192,203); } .middle img{ position:absolute; top:0;right:0;bottom:0;left:0; margin:auto; } .left{ width:220px; margin-left:-100%; left:-220px; background-color:rgb(255,239,219); } .right{ width:220px; margin-left:-220px; right:-220px; background-color:rgb(173,216,230); } .content-left,.content-right,.content-middle{ margin:50px; line-height:2em; } .content-left span{ background-color:rgb(255,150,150); } .content-right input{ width:90%; height:30px; display:block; } .content-right .sign{ background-color:red; color:#fff; border:none; } </ style > </ head > < body > <!-- 此处写代码 --> < div class = "header" > < div class = "logo" > < img src = "http://img1.sycdn.imooc.com/climg//58c0d2d900016ce303000100.png" > </ div > < div class = "ul" > < ul > < li >< a >课程</ a ></ li > < li >< a >职业路径</ a ></ li > < li >< a >实战</ a ></ li > < li >< a >猿问</ a ></ li > < li >< a >手记</ a ></ li > </ ul > </ div > </ div > < div class = "content" > < div class = "middle" > < div class = "content-middle" > < img src = "http://img1.sycdn.imooc.com/climg//590037e00001fab706000400.jpg" /> </ div > </ div > < div class = "left" > < div class = "content-left" > < h1 >课程推荐</ h1 > < p >< span >职业路径</ span >html与css3实现动态网页</ p > < p >< span >职业路径</ span >零基础入门android语法与界面</ p > < p >< span >职业路径</ span >iOS基础语法与常用控件</ p > < p >< span >职业路径</ span >PHP入门开发</ p > < p >< span >职业路径</ span >Java入门开发</ p > </ div > </ div > < div class = "right" > < div class = "content-right" > < h1 >登录</ h1 > < input type = "text" placeholder = "请输入邮箱/手机号" size = "25" />< br /> < input type = "password" placeholder = "6-16位密码,区分大小写,不能用空格" size = "25" />< br /> < input type = "button" value = "登录" class = "sign" /> </ div > </ div > </ div > < div class = "footer" > < ul > < li >< a >网站首页</ a ></ li > < li >< a >企业合作</ a ></ li > < li >< a >人才招聘</ a ></ li > < li >< a >联系我们</ a ></ li > < li >< a >友情链接</ a ></ li > </ ul > </ div > </ body > </ html > |
12
收起
正在回答 回答被采纳积分+1
2回答
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧