嗨,大家好我已经把内容给了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>
答案 0 :(得分:1)
为您的内容div应用此CSS样式:
#content
{
width:100%;
min-height:450px;
background-color:red;
float:left;
}
它将解决您的问题
答案 1 :(得分:0)
您需要添加
Geocoder geocoder = new Geocoder(context, Locale.getDefault());
Address address = geocoder.getFromLocation(lat, lng, 1);
Address obj = addresses.get(0);
latLng = new LatLng(obj.getLatitude(), obj.getLongitude());
final String addressText = String.format("%s, %s",obj.getMaxAddressLineIndex() > 0 ? obj.getAddressLine(0) : "",
obj.getCountryName());
您的其他代码应该相同。
答案 2 :(得分:0)
它只是意味着高度是#wrapper中身高的80% 所以在你的包装器中设置一个大小。
body
{
margin:0px;
background-color:lightseagreen;
}
#wrapper
{
height:700px; 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
{
margin-top:5%;
width:100%;
height:80%;
background-color:red;
float:left;
}
.details
{
width:100%;
height:80%;
float:left;
}
#footer
{
float:left;
margin-top:100%;
width:100%;
height:10%;
background-color:gray;
}
</style>