#默认是相对左上角定为的
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>制作我的第一个网页</title>
<style type="text/css">
div{
width:900px;
height:500px;
border:red solid;
background-image:url(http://img.mukewang.com/52da54ed0001ecfa04120172.jpg);
background-repeat:no-repeat;
background-position:40px 40px;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
#使图片相对右边定为
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>制作我的第一个网页</title>
<style type="text/css">
div{
width:900px;
height:500px;
border:red solid;
background-image:url(http://img.mukewang.com/52da54ed0001ecfa04120172.jpg);
background-repeat:no-repeat;
background-position:100% 40px;
border-right:50px solid transparent;
}
</style>
</head>
<body>
<div></div>
</body>
</html>