div里面加背景图一定要设置高度吗?是加背景图。
<!DOCTYPEhtml><htmllang="en"><head><metacharset="utf-8"/><metaname="viewport"content=...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link href="skin/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="skin/css/hbn.css" />
<script type="application/javascript" src="skin/js/jquery.min.js"></script>
<script language="JavaScript" src="skin/js/bootstrap.min.js"></script>
<title></title>
<style type="text/css">
.home_activity { background:url(skin/img/home_banner.png) no-repeat center;height: 122px;width: 100%;}
</style>
</head>
<body>
<div class="home_activity" >
图片的宽显示不出100%的效果
</div>
</body>
</html> 展开
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link href="skin/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="skin/css/hbn.css" />
<script type="application/javascript" src="skin/js/jquery.min.js"></script>
<script language="JavaScript" src="skin/js/bootstrap.min.js"></script>
<title></title>
<style type="text/css">
.home_activity { background:url(skin/img/home_banner.png) no-repeat center;height: 122px;width: 100%;}
</style>
</head>
<body>
<div class="home_activity" >
图片的宽显示不出100%的效果
</div>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询