怎样让两个正方形 横向排列_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:03:10
Original
1408 people have browsed it



如图 想让这两个正方形横向排列,怎么整,本人菜鸟一枚。。。。


回复讨论(解决方案)

1.diaplay:inline-block;
2.float:left;
3.定位也可以

浮动定位            就可以了

1.display:inline-block
2.float-left
3.position 


<!DOCTYPE html><html><head><title></title><meta charset="UTF-8"><style>.oDiv1,.oDiv2{width:100px;height:100px;border:1px solid #333;float:left;}.oDiv2{margin-left:4px;}</style></head><body><div class="oDiv1"></div><div class="oDiv2"></div></body></html>
Copy after login

1.display:inline-block  //ie6不兼容
建议用下面这两种:
2.float:left
3.position :absoult

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template