给form和button设置了同样的width,都未设置他们border时,为什么显示长度不一样呢?
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 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title >这是一个HTML文件</ title > < style type = "text/css" > *{ margin: 0; padding: 0; } .bodybody{ width:100%; margin-top: 100px; margin-bottom: 80px; } .headernav li,.footernav li,.left .left2list,.left .left1list{ list-style: none; } .header{ background:#000; width: 100%; height: 100px; min-width: 800px; position: fixed; top:0; } .pic{ background:url("http://img1.sycdn.imooc.com/climg//59093e9c00016ce303000100.png") no-repeat; width:300px; height:100px; float:left; } .headernav{ float: right; } .headernav li{ line-height:100px; color:#fff; float:left; margin-right:40px; } .left{ width: 60%; height: 600px; background: #9cf; float: left; } .left1{ float: left; margin-top:70px; margin-left: 110px; height: 10px; line-height: 40px; } .left1list span{ background: pink; } .left2{ float: left; margin-top:70px; margin-left: 140px; list-style:none; line-height: 40px; } .bodybody .middle{ width: 1%; height: 600px; background:#f9c; float:left; } .bodybody .right{ width: 39%; height: 600px; background: #9cf; float:right; } .footer{ width: 100%; height: 80px; background: #000; position: fixed; bottom:0; } .footernav{ text-align:center; } .footernav li{ display:inline-block; color:#fff; line-height:80px; margin:0 20px; } /*input::-webkit-input-placeholder{ color:#999; } 这是因为不同浏览器解析的原因 */ .form{ color: #999; display: block; width: 150px; height: 25px; /*border: 1px solid #eee;*/ } .button{ width:150px; height:25px; background: pink; display: block; /*border: 1px solid #eee;*/ } .login{ margin-top:70px; margin-left:70px; line-height: 30px; } h2,.form,.button{ margin: 20px; } </ style > </ head > < body > < div class = "header" > < div class = "pic" ></ div > < ul class = "headernav" > < li >课程</ li > < li >职业路径</ li > < li >实战</ li > < li >原文</ li > < li >手记</ li > </ ul > </ div > < div class = "bodybody" > < div class = "left" > < div class = "left1" > < h2 >课程推荐</ h2 > < ul class = "left1list" > < li >< span >职业路径</ span > 实现动态网页</ li > < li >< span >职业路径</ span > 实现动态网页</ li > < li >< span >职业路径</ span > 实现动态网页</ li > < li >< span >职业路径</ span > 实现动态网页</ li > < li >< span >职业路径</ span > 实现动态网页</ li > </ ul > </ div > < div class = "left2" > < h2 >相关课程</ h2 > < ul class = "left2list" > < li >HTML CSS JAVASCRIPT</ li > < li >HTML5 CSS3 JAVASCRIPT</ li > < li >移动端基础 移动APPA开发</ li > </ ul > </ div > </ div > < div class = "middle" ></ div > < div class = "right" > < div class = "login" > < h2 >登录</ h2 > < input type = "text" class = "form" placeholder = "请输入邮箱或手机" > < input type = "password" class = "form" placeholder = "请输入6-16位密码" > < input type = "submit" class = "button" value = "登录" > </ div > </ div > </ div > < div class = "footer" > < ul class = "footernav" > < li >网站首页</ li > < li >企业合作</ li > < li >人才招聘</ li > < li >联系我们</ li > < li >常见问题</ li > < li >友情链接</ li > </ ul > </ div > </ body > </ html > |
0
收起
正在回答 回答被采纳积分+1
2回答
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧