您的位置:首页 > 其它

用background 显示背景图的部分

2011-06-07 14:19 288 查看
<!DOCTYPE html>

<html>

<head>

<style>

body{margin:0;}

div{

width:200px;

height:100px;

margin:5px;

border:1px solid red;

background-image:url( http://www.google.com.hk/intl/zh-CN/images/logo_cn.png);
}

#div1{

background-position:left bottom;

}

#div2{

background-position:right top;

}

</style>

</head>

</body>

<div></div>

<div id="div1"></div>

<div id="div2"></div>

</body>

</html>



但是要求:

1:需要北京图片非常大

2:图片不能是透明的
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: