webapp设置适应pc和手机的页面宽高以及布局层叠图片文字

时间:2022-05-06
本文章向大家介绍webapp设置适应pc和手机的页面宽高以及布局层叠图片文字,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<title>我趣旅行网-美剧迷</title>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" type="text/css" href="test.css">
	</head>
	<body>
		<div class="wrapper">
			<img class="bg" src="img/background.png"/>
			<img class="logo" src="img/pisode_logo.png">
			<p class="pisode">Pisode</p>
		</div>
	</body>	
</html>	

css:

html,body{
	height:100%;
	margin:0;
	padding:0;
}
.wrapper{
	position:relative;
	margin: 0 auto;
	max-width: 500px;
	min-height: 100%;
	text-align: center;
	width: 100%;
}
.bg{
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	z-index: -1;
	height: 100%;
}
.logo{
	width:100%;
}
.pisode{
	font-size:14px;
}

访问链接:http://2.chuang8.sinaapp.com