基于bootstrap的背景图自适应屏幕大小的页面

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>详情</title>
		<script type="text/javascript" src="../js/jquery.js"></script>
			<script src="../js/bootstrap.min.js"></script>
		    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
		    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
			<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
			<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
			<!-- 可选的 Bootstrap 主题文件(一般不用引入) -->
			<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
		
	</head>
	<body>
		<div id="mainDiv"></div>
		<div id="backbutton">
			<a class="btn btn-danger dropdown-toggle" style="margin: 10px;" a href="#">
				 <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"> 返回
			</a>
		</div>
		<div id="content">
			建设中。。。
		</div>
	</body>
</html>
<style type="text/css">
	body,html {
		width: 100%;
		height: 100%;
	}
	#mainDiv {
		width: 100%;
		height: 100%;
		background: url(../img/back_img.png) no-repeat;
		background-size: 100% 100%;
		z-index: -1;
		position:absolute;
		/* text-align: center; */
		display: flex;
		/* align-items: center;        /* 垂直居中 */ */
		justify-content: center;    /* 水平居中 */
	}
	#backbutton{
		position: absolute;
	}
	#content {
		width: 100%;
		height: 100%;
		text-align: center;
		line-height: 700px;
		color: white;
		font-size: 45px;
		z-index: 1;
	}
  #box::-webkit-scrollbar {
   width: 0px;
  } 
</style>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

静梵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值