Home  >  Article  >  Web Front-end  >  求解CSS浮动样式_html/css_WEB-ITnose

求解CSS浮动样式_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:31:001364browse

怎么才能使得粉红色的div模块放在绿色的div模块后面啊?


nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



无标题文档





    

        

        

        

    

    



回复讨论(解决方案)

#test3{
width:50px;
height:50px;
background:green;
clear:left;
flaot:left;
}

修正 为 float:left;

#test3{width:50px;height:50px;background:green;clear:left;flaot:left;}

float写错了

新手的通病

可以添加一个class 方便调用:

.clear{clear:both;overflow:hidden;height:0px;line-height:0px;font-size:0px;}


<div id="container">    	<div id="test1"></div>        <div id="test2"></div>		<div class="clear"></div>     /*添加一个div*/        <div id="test3"></div>        <div id="test4"></div></div>

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