Home > Web Front-end > HTML Tutorial > Ask about a simple div floating problem_html/css_WEB-ITnose

Ask about a simple div floating problem_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:38:47
Original
1104 people have browsed it

I just learned CSS float, and I want the second div to be on the right of the first div, and the third div below the first div. The code is as follows, but the third div appears and the second div appears. div is covered, why?

<body>	<div id="div_1" style="float:left">    风风风风风风风f风    </div>    	<div id="div_2">    火火火火火火火火    </div>    	<div id="div_3">    水水水水水水水水    </div></body>
Copy after login


The results show:


Reply to discussion (solution)

Also add #div_2 Let's add a left float

Let's add a left float to #div_2


After adding a left float to div_2, I found that the border and background of the third div were gone...


Add a left float to #div_2


After adding a left float to div_2, I found that the border and background of the third div were gone...
The first and second left floats
The third clear: both;
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