我试了:width:100%;overflow:hidden的方法...然而并没有什么" "用.这是为什么?
浏览器是火狐的,然而并没有什么" "用.
浏览器是火狐的,然而并没有什么" "用.
2015-08-14
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>清除浮动</title>
<style type="text/css">
#box1{height: 50px;background-color: red;float:left;}
#box2{height: 50px;background-color: blue;float:right;}
p{background: green none repeat scroll 0;
color:#fff;
width: 100%;
overflow: hidden;}
</style>
</head>
<body>
<div id="box1">我是盒子1</div>
<div id="box2">我是盒子2</div>
<p>我是P 元素我是P 元素我是P 元素我是P 元素我是P 元素我是P 元素我是P 元素我是P 元素我是P 元素</p>
</body>
</html>我这样可以呀~~不知道你的为什么不可以呢
举报