大家好,我已经将内容设置为 80% 高度,但我没有得到它,请告诉我我犯的错误。我之前以类似的方式制作网页,但这次只有我得到错误。我会很高兴如果有人帮助我。
body
{
margin:0px;
background-color:lightseagreen;
}
#wrapper
{
height:100%;
min-height:100%;
width:100%;
background-color:red;
padding:0px;
margin:0px;
}
#header
{
height:10%;
width:100%;
}
#navbar
{
height:10%;
width:100%;
background-color:black;
color:white;
float:left;
}
#navbar ul li
{
width:70%;
display:inline;
padding:17px 25px;
}
#navbar ul li a
{
color:white;
}
#navbar ul li:hover
{
background-color:lightgrey;
}
#content
{
width:100%;
height:80%;
background-color:red;
float:left;
}
.details
{
width:100%;
height:80%;
float:left;
}
#footer
{
width:100%;
height:10%;
background-color:gray;
}
<!doctype html>
<html>
<head>
<title>student</title>
<link rel="stylesheet" type="text/css" href="ab.css">
</head>
<body>
<div id="wrapper"><!--start wrapper-->
<div id="header">
<div id="navbar"><!--start nav-->
<ul>
<li>About us</li>
<li>Contact</li>
<li>Services</li>
<li>Sign</li>
</ul>
</div><!--end nav-->
</div>
<div id="content"><!--start content-->
<div class="details">
here
</div>
</div><!--end content-->
<div id="footer"><!--start footer-->
copyrights to N.sudharsan
</div><!--end footer-->
</div><!--end wrapper-->
</body>
</html>
最佳答案
Apply this CSS Style for you content div:
#content
{
width:100%;
min-height:450px;
background-color:red;
float:left;
}
它会解决你的问题
关于html - 我没有得到我给它的高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39038174/