CSS 基础学习-247 css使用多个背景图像

hrs, 14 九月, 2023

实例代码:

<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<style>
			div{
				background-image:url(img/OIP-C.png),  url(img/tree.png), url(img/aa.jpg);
				background-repeat:no-repeat,no-repeat,repeat;
				background-position:left top,right bottom,left top;
				background-size:50px, 130px, auto;
				padding:15px;
				border:1px solid red;
			}
		
		</style>
	</head>
	<body>
		<div>
			<h1>Welcome to Shanghai</h1>
			<P>Shanghai is one of the four direct-administered municipalities of the People's Republic of China. Welcome to Shanghai!

The city is located on the southern estuary of the Yangtze, with the Huangpu River flowing through it.</p>
		</div>
	</body>
</html>

运行效果:

标签

评论