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

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

WBOY
Release: 2016-06-21 09:31:00
Original
1406 people have browsed it

怎么才能使得粉红色的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;}
Copy after login

float写错了

新手的通病

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

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


<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>
Copy after login

Related labels:
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