为什么在.load里写overflow: hidden;盒子不居中

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
	<style type="text/css">
		*{
	padding: 0;
	margin: 0;
}
a{
	text-decoration: none;
}
.comwidth{
	width: 1000px;
	margin: 0 auto;
}
#top{
	height: 60px;
	
	
}
.logo{
	float: left;
}
.welcome{
	float: left;
	font-size: 24px;
	line-height: 60px;
}
.welcome a{
	color: #000;
	font-weight: bold;
}
.logo_a{
	float: right;
	margin: 38px 0 10px 0;
	font-size: 14px;
}
.logo_a a{
	color: #777;	
}

#main{
	height: 475px;
	background-color: #e80404;
}
.load{
	border: 5px #ff0 solid;
	overflow: hidden;
}
.loadbox{
	width: 350px;
	height: 300px;
	background-color: #fff;
	float: right;
	margin-top: 40px;
}
	</style>
</head>

<body>
	<div id="box">
		<div id="top" class="comwidth">
			<p class="welcome"><a href="#">欢迎登陆</a></p>
			<p class="logo_a"><a href="#">登录页面,调查问卷
</a></p>
		</div>
		<div id="main">
			<div class="comwidth load">
				<div class="loadbox">

				</div>
			</div>
		</div>
	</div>
</body>
</html>



请问为什么.load里写overflow: hidden;盒子不居中而去掉.load里的overflow: hidden;加在.comwidth里盒子就能居中

.comwidth {

    width: 1000px;

    margin: 0 auto;

    overflow: hidden;

}




啊啊啊啊123
浏览 1770回答 1
1回答

MarlboroKay

建议你先理解overflow属性,其次,你的.load都没有宽高,何来超出呢。 你不妨给.load加个宽高试下。 半夜回答不易,望采纳!
打开App,查看更多内容
随时随地看视频慕课网APP