Home > Web Front-end > HTML Tutorial > After using float in CSS, if the browser interface is reduced, the box will float down. _html/css_WEB-ITnose

After using float in CSS, if the browser interface is reduced, the box will float down. _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:21:14
Original
1469 people have browsed it

CSS interface HTML float positioning

Let me give a simple example:
<head><style type="text/css">			/*自定义盒子的大小*/			div{				border:#999 solid 1px;				height:200px;				width:300px;}						#div_1{background-color:#0FF;			float:left;			}						#div_2{background-color:#F0F;			float:left;						}						#div_3{background-color:#FF0;						}			</style></head><body>            <div id="div_1">第一个盒子</div>            <div id="div_2">第二个盒子</div>            <div id="div_3">第三个盒子</div></body>
Copy after login

If the browser interface is reduced, the second and third boxes will float to the first box The following is gone, how to solve it?


Reply to the discussion (solution)

When maximizing the interface at the beginning, it looks like this: 口口口
After shrinking the browser interface, it becomes: 口
                                                                                                                                                                                                                                                                                                 .

<body>   <html style="min-width:906px;overflow-x:auto;">            <div id="div_1">第一个盒子</div>            <div id="div_2">第二个盒子</div>            <div id="div_3">第三个盒子</div>   </html></body>
Copy after login
Just use a table to dice the two modules. . .
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