您的位置:首页 > 其它

背景图片拉伸效果(转)

2014-12-30 16:32 253 查看
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
body {
padding: 0;
margin: 0;
overflow-x: hidden;
background: url(ss.jpg) center no-repeat;
background-size: cover;
}
</style>
</head>
<body>
<script src="Scripts/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function () {
function resizeBody() {
$("body").height($(window).height() - 2).width($(window).width() - 2);
}
resizeBody();

$(window).resize(function () {
resizeBody();
});
});
</script>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: