我不明白为什么我会得到不想要的空间,我希望divclubs
和events
div 处于相同的高度但在header
div 之下。
实际上,我在标题和俱乐部和活动 div 之间留出了很大的空间。
的HTML:
<!DOCTYPE html>
<html>
<head>
<title>Metzo</title>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div class="metzo">
<div class="header">
</div>
<!-- Getting a huge space here in the y-axis -->
<div class="clubs">
hello
</div>
<div id="space1"> </div>
<div class="events">
hello
<?php
//include("event.php");
//include("event.php");
//include("event.php");
?>
</div>
</div>
</body>
</html>
的CSS:
html {background-color:black;}
html, body { height: 100%; width: 100%; margin-top: 1%; color:white;}
.metzo
{
width:80%;
height: 80%;
padding:0px;
margin-left:10%;
margin-right:10%;
/*margin-bottom:5%;*/
text-align:center;
}
.header
{
width:100%;
height:10%;
border:solid thick white;
}
.clubs
{
display:inline-block;
width:45%;
height:100%;
border:solid thick white;
margin-top:0px;
}
#space1 {
display:inline-block;
width:3%;
height:100%;
float:top;
/*border:solid thick white;*/
}
.events
{
display:inline-block;
width:45%;
height:100%;
border:solid thick white;
text-align:center;
}