87,910
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
html,body {
margin: 0;
height: 100%;
background-color: #ccc;
}
#gh {
position: fixed;
width: 100%;
height: 50px;
left: 0;
top: 0;
z-index: 2;
background-color: #c33;
}
#gf {
position: fixed;
width: 100%;
height: 50px;
left: 0;
bottom: 0;
z-index: 2;
background-color: #c90;
}
#content {
position: absolute;
top: 70px;
bottom: 70px;
left: 20px;
right: 20px;
}
#content > img {
width: 100%;
height: 100%;
object-fit: contain;
}
</style>
</head>
<body>
<div id="gh"></div>
<div id="content">
<img src="a.jpg">
</div>
<div id="gf"></div>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
html,body {
margin: 0;
height: 100%;
background-color: #ccc;
}
#gh {
position: fixed;
width: 100%;
height: 50px;
left: 0;
top: 0;
z-index: 2;
background-color: #c33;
}
#gf {
position: fixed;
width: 100%;
height: 50px;
left: 0;
bottom: 0;
z-index: 2;
background-color: #33c;
}
#content {
position: absolute;
top: 70px;
bottom: 70px;
left: 20px;
right: 20px;
background: url("a.jpg") no-repeat center center / contain;
}
</style>
</head>
<body>
<div id="gh"></div>
<div id="content"></div>
<div id="gf"></div>
</body>
</html>