sublime做的:<html> <head> <meta charset="UTF-8"> <title>Document</title> <style> .main{ margin: 0 auto; width: 810px; height: 200px; background-color: darkgray; } .left{ width: 200px; background-color: red; float: left; height: 200px; } .right{ width: 600px; height: 200px; background-color: blue; float: right; } </style> </head> <body> <div class="main"> <div calss="left">left</div> <div class="right">right</div> </div> </body></html>Hbuilder做的<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>title</title> <style> .main{ margin: 0 auto; width: 810px; height: 200px; background-color: darkgray; } .left{ width: 200px; background-color: red; float: left; height: 200px; } .right{ width: 600px; float: right; background-color: blue; height: 200px; } </style> </head> <body> <div class="main"> <div class="left">left</div> <div class="right">right</div> </div> </body></html>效果:
1 回答
已采纳
qq_青枣工作室_0
TA贡献446条经验 获得超754个赞
因为你Sublime后面的写错了
<div class="main"> <div calss="left">left</div> <div class="right">right</div>
上面的<div calss="left">left</div>里面的calss写错,要改为class
- 1 回答
- 0 关注
- 1597 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消