Home  >  Article  >  Web Front-end  >  怎样让两个正方形 横向排列_html/css_WEB-ITnose

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

WBOY
WBOYOriginal
2016-06-21 09:03:101385browse



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


回复讨论(解决方案)

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>

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

Statement:
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