<!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>

最新文章

  1. map
  2. //build-&gt;//learn-&gt;//publish
  3. JSON讲解和“弹窗”
  4. IBatis.Net 表连接查询(五)
  5. Objective-C 学习记录4
  6. Google中rel=&quot;canonical&quot;的相关解释和用法
  7. jsp实现计算器
  8. 【Uvalive 5834】 Genghis Khan the Conqueror (生成树,最优替代边)
  9. Problem 1108 - 淼&#183;诺贝尔
  10. Csharp多态的实现概述
  11. 第10章 协议和声明类型常量 - IdentityModel 中文文档(v1.0.0)
  12. DVWA-命令执行学习笔记
  13. window环境下使用filezilla server搭建ftp服务器
  14. 同步调用异步方法how-would-i-run-an-async-taskt-method-synchronously
  15. 移动端 h5开发相关内容总结(三)
  16. 跟我一起学习vue2(学习工程目录)[三]
  17. python学习笔记Day2
  18. 【题解】 bzoj2460: [BeiJing2011]元素 (线性基)
  19. The ECDSA host key for XXX has changed
  20. HDU 1084:What Is Your Grade?

热门文章

  1. SUST OJ 1671: 数字拼图
  2. 读取地址C语言
  3. MySQL--REPLACE INTO更新自增列值引发的异常
  4. timescaledb 集成prometheus
  5. DD_belatedPNG解决IE6下PNG不透明问题
  6. 转详解Zoosk千万用户实时通信背后的开源技术
  7. PHP中数组的各种用法
  8. php 的交互命令行
  9. 【转】每天一个linux命令(5):rm 命令
  10. mac 使用