<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>背景位置-精确单位</title>
<style>
div {
width: 300px;
height: 300px;
background-color: pink;
background-image: url(images/logo.png);
background-repeat: no-repeat;
/* 20px 50px; x轴一定是 20 y轴一定是 50 */
/* background-position: 20px 50px; */
/* background-position: 50px 20px; */
background-position: 20px;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
CSS-43:背景位置-精确单位
最新推荐文章于 2023-09-01 16:34:23 发布