请老师帮我看看我代码的问题,谢谢
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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title ></ title > < style type = "text/css" > /*此处写代码*/ * { padding: 0; margin: 0; } body { min-width: 900px; } .contarner { padding: 0 200px 0 220px; } .middle, .right, .left { position: relative; min-height: 300px; float: left; } .head { float: left; background-color: black; width: 100%; height: 100px; color: white; line-height: 100px; } .foot { float: left; background-color: black; width: 100%; height: 100px; color: white; line-height: 100px; text-align: center; } .middle { width: 100%; background-color: #FFC0CB; } .left { width: 220px; background-color: #FFDBEF; margin-left: -100%; left: -220px; height: 404px; } .right { width: 200px; background-color: #B0D8E6; margin-left: -200px; right: -200px; height: 404px; } .head img { float: left; width: 300px; height: 100px; } .head ul li { list-style-type: none; color: white; float: right; margin-left: 20px; } .orange:hover { color: orange; } .foot ul li { list-style-type: none; color: white; float: left; margin: 0 54px; } .foot ul { margin: 0 200px; /**感觉底部有问题 不够居中 希望老师帮我看看**/ height: 100px; font-size: 20px; } .middle img { width: 400px; height: 300px; margin: 50px 350px 50px 350px; background-clip: content-box; } .contarner_left { margin: 100px 0px 150px 50px; } li span { background-color: #B56A6C; } .contarner_left ul li { font-size: 8px; list-style-type: none; margin-top: 10px; } .contarner_right { margin: 50px 0px 150px 10px; } input { width: 180px; height: 30px; margin: 20px 10px 20px 0px; } input:nth-child(3) { background-color: red; color: white; } </ style > </ head > < body > <!-- 此处写代码 --> < div class = "head" > < img src = "http://img1.sycdn.imooc.com/climg//590037f600016ce303000100.png" > < ul > < li >< a class = "orange" >手记</ li > < li >< a class = "orange" >猿问</ li > < li >< a class = "orange" >实战</ li > < li >< a class = "orange" >职业路径</ li > < li >< a class = "orange" >课程</ li > </ ul > </ div > < div class = "contarner" > < div class = "middle" >< img src = "http://img1.sycdn.imooc.com/climg//590037e00001fab706000400.jpg" ></ div > < div class = "left" > < div class = "contarner_left" > < ul >课程推荐 < li >< span >职业路径</ span >HTML5与CSS3实现动态网页布局</ li > < li >< span >职业路径</ span >零基础入门Android语法与界面</ li > < li >< span >职业路径</ span >iOS基础语法与常用控件</ li > < li >< span >职业路径</ span >PHP入门开发</ li > < li >< span >职业路径</ span >JAVA入门开发</ li > </ ul > </ div > </ div > < div class = "right" > < div class = "contarner_right" > < form >登录 < input type = "text" name = "usename" placeholder = "请输入登陆邮箱/手机号" > < input type = "password" name = "usename" placeholder = "6~16位密码,区分大小写,不能用空格" > < input type = "submit" name = "tj" value = "登录" > </ form > </ div > </ div > </ div > < div class = " foot " > < ul > < li >网站首页</ li > < li >企业合作</ li > < li >人才招聘</ li > < li >联系我们</ li > < li >常见问题</ li > < li >友情链接</ li > </ ul > </ div > </ body > </ html > |
18
收起
正在回答
2回答
1、左侧和右侧滑过的有橙色变化,原因是缺少结束的</a>标签:
建议添加结束的</a>标签,并且设置代码如下:
2、界面出现了横向滚动条,原因是设置了margin宽度超出造成的,建议设置代码如下:
3、为什么正常网页打开的时候和F12调试时候的显示不一样
这是因为你没有设置固定的宽度,因此网页的内容会根据浏览器窗口的大小变化而变化,即,你使用F12调试的时候,网页显示的区域就发生了变化,因此网页的内容也就跟着变化了,这里涉及到响应式,在后面的进阶课程中会有讲解的~
希望可以帮到你~
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧