我現在正在建立一個簡單的網站,有一個標題,一個垂直導航和一個內容框,我在一些小事情上失敗了。建立HTML結構網站沒有反應
<html>
<head>
<title>Website</title>
<link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="header"></div>
<div class="nav_content_container">
<div class="nav"></div>
<div class="content"></div>
<div class="floatkiller"></div>
</div>
</div>
</body>
</html>
,並給它一些CSS後
body {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px;
background-color: lightgray;
}
.container {
height: 100%;
width: 77%;
margin: 0px auto;
background-color: white;
border: 3px solid black;
}
.header {
height: 20%;
width: 100%;
background-color: yellowgreen;
border-bottom: 3px solid black;
}
.nav_content_container {
height: 80%;
width: 100%;
background-color: azure;
}
.nav {
height: 100%;
width: 20%;
float: left;
background-color: palevioletred;
border-right: 3px solid black;
}
.content {
height: 100%;
width: 80%;
float: left;
background-color: cornflowerblue;
}
.floatkiller {
float: none;
clear: both;
}
我的網站在beeing responsiv失敗或者是準確的,我的網站獲取是一個身高超過100%,我content
箱滴出nav_content_container
。如果我沒有給出任何邊界,一切都沒問題,但是在應用邊界後,我的網站被破壞了。爲什麼邊界將一切都打破?