您的位置:首页 > Web前端 > CSS

背景图片拉伸效果(css3支持)

2012-11-08 10:56 495 查看
<!DOCTYPE HTML>
<html>
<head>
<title>背景图片拉伸效果(css3支持)</title>
<style type="text/css">
body{
padding:0;
margin:0;
overflow-x: hidden;
background:url(ss.jpg) center no-repeat;
background-size:cover;
}

</style>
<script type="text/javascript" src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
$(function(){
function resizeBody(){
$("body").height($(window).height() - 2).width($(window).width() - 2);
}
resizeBody();

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