以下是 HTML5网页背景自适应缩放代码 的示例演示效果:
部分效果截图:
HTML代码(index.html):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="JS代码,其他代码,JS广告代码,JS特效代码" />
<meta name="description" content="此代码内容为HTML5网页背景自适应缩放代码,属于站长常用代码" />
<title>HTML5网页背景自适应缩放代码</title>
<link href="css/lrtk.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- 代码 开始 -->
<section id="h1" class="jawbone-takeover-minimulti jawbone-hero"><i class="jawbone-hero-image" data-hero-image-fixed="true" data-hero-image-fade="true" data-hero-min-opacity=".3" style="opacity: 1.05;"></i></section>
<!-- 代码 结束 -->
</body>
</html>
CSS代码(lrtk.css):
/* ����ͼ�� �Ѽ����� www.lanrentuku.com */
.jawbone-hero .jawbone-hero-image{position:absolute;background:transparent none no-repeat scroll 50% 0;background-size:cover;top:0;bottom:0;left:0;right:0;width:100%;margin:0 auto;z-index:-1}
.jawbone-hero{height:100%;min-height:550px}
.jawbone-hero .jawbone-hero-image{position:fixed}
#h1.jawbone-takeover-minimulti .jawbone-hero-image{background-image:url(../images/hero-600.jpg)}
@media (min-width:600px){#h1.jawbone-takeover-minimulti .jawbone-hero-image{background-image:url(../images/hero-1280.jpg)}
}
@media (min-width:1016px){#h1.jawbone-takeover-minimulti .jawbone-hero-image{background-image:url(../images/hero-2000.jpg)}