CSS3之background-origin
1、属性简介
background-origin:border|content|padding|!important
border:从border区域开始显示背景;
content:从content区域开始显示背景;
padding:从padding区域开始显示背景。
/*背景图像相对边框盒来定位*/ background-origin:border-box; /*背景图像相对内容框来定位*/ background-origin:content-box; /*背景图像相对于内边距框来定位*/ background-origin:padding-box; /*提高指定样式规则的应用优先权*/ background-origin:!important;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS3之background-origin</title>
<style type="text/css">
body{
background-color:#FCC;
width:60%;
height:100px;
font-size:24px;
font-weight:bolder;
}
div{
background:#C6F url(image.jpg);
background-color:#9FF;
width:100%;
height:100%;
-moz-background-origin:border;
-webkit-background-origin:border;
/*-moz-background-origin:content;
-moz-background-origin:padding;
-webkit-background-origin:padding;
-webkit-background-origin:!important;
-moz-background-origin:!important;*/
}
</style>
</head>
<body>
<div>
CSS3之background-origin
</div>
</body>
</html>
4、运行结果
CSS3之background-origin的更多相关文章
- CSS3中background属性的调整
CSS3对于background做了一些修改,最明显的一个就是采用设置多背景,不但添加了4个新属性,并且还对目前的属性进行了调整增强. 1.多个背景图片 在css3里面,你可以再一个标签元素里应用多个 ...
- css3 背景background
Css3背景<background> Css3包含多个新的背景属性,它们提供了对背景更强大的控制.可以自定义背景图的大小,可以规定背景图片的定位区域,css3还允许我们为元素使用多个背景图 ...
- css3-background clip 和background origin
1.background-origin background-origin 里面有3个参数 : border-box | padding-box | content-box; border-box,p ...
- css2和CSS3的background属性简写
1.css2:background:background-color || url("") || no-repeat || scroll || 0 0; css3: backg ...
- css3的Background新属性
前言 CSS3中出现了几种关于背景图片的新属性:background-origin.background-clip.background-position等.之前大致了解了下,但是background ...
- CSS背景和CSS3背景background属性
css背景属性用于定义HTML元素的背景 背景属性既可以为单个的单元设置背景,也可以为整个页面设置背景,可以对上述二者的任意组合设置背景,段落.文字.不同状态的链接.图像.内容区域修改其背景样式.设置 ...
- css3之background
background background: (1)url(image1.png) right bottom, (2)url(image2.png) center, (3)url(image3.png ...
- [CSS3] CSS Background Images
Body with background image and gradient html { background: linear-gradient(#000, white) no-repeat; h ...
- 巧用CSS3之background渐变
常见斑马loading 上图是我们常见的loading进度条,以前都是用一张背景图片平铺的.其实如果抛去兼容性因素,我们可以用零图片纯样式来实现. 一,首先,我们先为容器定义一个纯蓝色背景: box{ ...
- css3 background
background是一个很重要的css属性,在css3中新增了很多内容.一方面是原有属性新增了属性值,另一方面就是新增了3个属性. 一.css3中新增属性值介绍 css2的background有5个 ...
随机推荐
- spark头脑镜像
思考是一件有意思的事情.遇到问题,思考出结论,那么脑子里面的过程是什么呢,或者脑子里面是什么呢.我一直认为,这团团的里面是一个模糊的n维空间.理解一个复杂的系统.公式.算法,都要在这个n维空间里具象化 ...
- 使用FileReader实现前端预览所选图片
需求描述 在浏览器环境下进开发网站(也就是B/S架构的应用),获取到当前设备上的图片后,希望可以在上传到服务器前简单预览一下图片内容. 具体实现 主要代码 html 部分 <input type ...
- pytho字符串处理内置方法一览表
序号 方法及描述 1 capitalize()将字符串的第一个字符转换为大写 2 center(width, fillchar) 返回一个指定的宽度 width 居中的字符串,fillchar 为填充 ...
- Annotation基础知识
1.Annotation介绍 Annontation是Java5开始引入的新特征.中文名称一般叫注解. Annontation像一种修饰符一样,应用于包.类型.构造方法.方法.成员变量.参数及本地变量 ...
- BZOJ 3295: [Cqoi2011]动态逆序对 [CDQ分治]
RT 传送门 首先可以看成倒着插入,求逆序对数 每个数分配时间(注意每个数都要一个时间)$t$,$x$位置,$y$数值 $CDQ(l,r)$时归并排序$x$ 然后用$[l,mid]$的加入更新$[mi ...
- mysql 5.7 支持json格式
1.JSON格式的支持:mysql> create table user ( uid int auto_increment, -> data json,primary key(u ...
- neo-thinsdk-cs 之 thinWallet 接入私链
neo-thinsdk-cs 之 thinWallet 接入私链 2017年底刚开始接触区块链,目前在被 NEO 折磨. 一开始被官方文档和 NEO-GUI 搞得体无完肤(尤其是传说中的 F12),也 ...
- Three.js 学习笔记(1)--坐标体系和旋转
前言 JavaScript 3D library The aim of the project is to create an easy to use, lightweight, 3D library ...
- springmvc log4j 配置
web.xml 增加 <context-param> <param-name>log4jConfigLocation</param-name> <param- ...
- Git 上传 GitHub
1.下载 2.安装 3.功能识别 3-1.查看git版本 git --version 3-2.移除原来的版本 yum remove git 4.配置 4-1.用户配置信息 git config ...