html - 我没有得到我给它的高度

标签 html css

大家好,我已经将内容设置为 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/

相关文章:

html - 如何将 Bootstrap 4 中的 SVG 垂直对齐到行高?

css - 如何在 IE 11 上使用线性渐变制作背景图像?

html - 在 HTML 页面上 float gif 图像

python - PyQt WebKit CSS 背景图片未显示

javascript - 如何在不使用外部库的情况下语法突出显示可进行内容编辑的div?

html - 使 Div 开关 float

html - TABLE 比包含 DIV 更宽

javascript - 如何仅使用一个图像标签来显示多张图像?

css - 求助css,让div默认为页面长度

css - 保持 wordpress 子菜单打开几秒钟