9.求背景图片左边到#box盒子左边外框侧的距离
2024-10-21 17:37:57
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>求背景图片左边到#box盒子左边外框侧的距离</title> <style type="text/css">
* {
margin: 0;
padding: 0;
} #box{
width: 100px;
height: 200px;
background: pink;
padding: 100px;
border: 80px solid blue;
background-image: url("img/1.png");
background-repeat: no-repeat;
background-origin: content-box;/* 背景图片起始源的位置 */
background-position: -50px 0; /* 左右 上下*/
/* background-position 和margin (上下 ; 左右) 等不一样*/
} /*答案:130px*/
</style>
</head>
<body>
<div id="box"></div>
</body>
</html>
最新文章
- map
- //build->;//learn->;//publish
- JSON讲解和“弹窗”
- IBatis.Net 表连接查询(五)
- Objective-C 学习记录4
- Google中rel=";canonical";的相关解释和用法
- jsp实现计算器
- 【Uvalive 5834】 Genghis Khan the Conqueror (生成树,最优替代边)
- Problem 1108 - 淼&#183;诺贝尔
- Csharp多态的实现概述
- 第10章 协议和声明类型常量 - IdentityModel 中文文档(v1.0.0)
- DVWA-命令执行学习笔记
- window环境下使用filezilla server搭建ftp服务器
- 同步调用异步方法how-would-i-run-an-async-taskt-method-synchronously
- 移动端 h5开发相关内容总结(三)
- 跟我一起学习vue2(学习工程目录)[三]
- python学习笔记Day2
- 【题解】 bzoj2460: [BeiJing2011]元素 (线性基)
- The ECDSA host key for XXX has changed
- HDU 1084:What Is Your Grade?