css 清除浮动的两种常用方式_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 08:57:24
Original
1091 people have browsed it

<!DOCTYPE html><html><head>    <meta charset="UTF-8">    <title></title>    <style type="text/css">        .box1{            background-color: #006486;            float: left;        }        /*清除浮动        .p{            clear: both;        }        */                .p{            width: 100%;            overflow: hidden;        }    </style></head><body>    <div>dfafa</div>    <p>pppppdsfafaf</p>    <div>dsfafa</div></body></html>
Copy after login

float:影响的元素是其紧邻的元素,清除浮动在其紧邻受影响的元素清除即可

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