<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Document</title>
<style type="text/css">
div{
width: 332px;
height: 341px;
border:20px solid rgba(0, 0, 0, 0.5);
padding:20px;
background: url(img/am.jpg) no-repeat;
/* background-origin: border-box; */
<strong><span style="font-size:18px;"> background-origin: content-box;</span></strong>
}
</style>
</head>
<body>
<div>我是内容哦</div>
</body>
</html>css3的背景坐标
最新推荐文章于 2021-08-03 18:54:14 发布
本文介绍了一个具体的CSS样式案例,通过定义div元素的宽度、高度、边框、内边距及背景图片,展示了如何使用content-box属性来实现背景图的精确定位。此案例有助于理解CSS中背景图显示区域的设置。
1259

被折叠的 条评论
为什么被折叠?



