2019-3-2 网页设计教学 图片的两种使用方法

版权声明:本文为博主原创文章,博主QQ:289102120,博主Mobile:15891712396 https://blog.csdn.net/vinglemar/article/details/88074121
<!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=utf-8" />
<title>无标题文档</title>
<style type="text/css">
#two {
	background-image: url(Img/girl.jpg);
	height: 279px;
	width: 343px;
}
#three {
	background-image: url(Img/girl.jpg);
	height: 279px;
	width: 343px;
	background-position: -500px -150px;
}
#four {
	background-image: url(Img/girl.jpg);
	height: 279px;
	width: 343px;
	background-position: center center;
}
</style>
</head>

<body>
<div><img src="Img/girl.jpg" width="343" height="279" /></div>
<hr />
<div id="two">2222222222222222</div>
<hr />
<div id="three">333333333333</div>
<hr />
<div id="four">333333333333</div>
</body>
</html>

图片素材:

猜你喜欢

转载自blog.csdn.net/vinglemar/article/details/88074121