如图所示这样的遐思你受的了吗?
<!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> .container { width: 1000px; height: 400px; background: #ddd; /*font-size: 0px;*/ } .left { width: 300px; height: 100px; background: #7ac; display: inline-block; } .right { width: 500px; height: 100px; background: #678; display: inline-block; } </style> </head> <body> <div class="container"> <div class="left"></div> <div class="right"></div> </div> </body> </html>
为什么呢?
最终我们找到div和div之间有一个换行符
我们去掉试试
最后就好了。
当然我们也可以使用font-size:0来做。
评论一下?