博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
css样式背景中加背景_CSS多背景
阅读量:2516 次
发布时间:2019-05-11

本文共 1934 字,大约阅读时间需要 6 分钟。

css样式背景中加背景

Anyone that's been in the web development industry for 5+ years knows that there are certain features that we should have had several years ago. One of those features is the ; we used JavaScript shims for a decade before placeholder came along. Another one of those simple features is multiple background images with CSS. Instead we'd need to nest another element for every additional background image. Now we a syntax for supporting multiple background images on one element, and here's what it looks like.

在Web开发行业从事5年以上的任何人都知道,几年前我们应该拥有某些功能。 这些功能之一是 ; 在占位符出现之前,我们使用JavaScript填充片已有十年之久。 这些简单功能中的另一个功能是带有CSS的多个背景图片。 相反,我们需要为每个其他背景图像嵌套另一个元素。 现在,我们使用一种语法在一个元素上支持多个背景图像,这就是它的外观。

CSS (The CSS)

Multiple backgrounds involved using multiple property assignments with multiple values, separated by a comma:

多个背景涉及使用多个属性分配和多个值(以逗号分隔):

#multipleBGs {	background: url(photo1.png),				url(photo2.png),				url(photo3.png)	;	background-repeat: no-repeat,					   no-repeat,					   repeat-y;							background-position: 0 0,						 30px 70px,						 right top;		width: 400px; 	height: 400px;	border: 1px solid #ccc;}

Trying to stuff all properties via shorthand within the background property wont work, unfortunately; multiple property declarations must be used. All of the background properties may be used (background-attachment , background-clip , background-image , background-origin , background-position , background-repeat , background-size), as well as CSS gradients.

不幸的是,试图通过速记将所有属性填充到后台属性中是行不通的; 必须使用多个属性声明。 可以使用所有背景属性(background-attachment,background-clip,background-image,background-origin,background-position,background-repeat,background-size)以及CSS渐变。

Another awesome CSS feature that we can finally used. Using multiple CSS backgrounds is an incredible useful tool, preventing the need for nested elements for the sole purpose of formatting.

我们终于可以使用的另一个很棒CSS功能。 使用多个CSS背景是一种令人难以置信的有用工具,可避免仅出于格式化目的就需要嵌套元素。

翻译自:

css样式背景中加背景

转载地址:http://ouvwd.baihongyu.com/

你可能感兴趣的文章
hdu4348 - To the moon 可持久化线段树 区间修改 离线处理
查看>>
springMVC中一个class中的多个方法
查看>>
cxx signal信号捕获
查看>>
《Android开发艺术探索》读书笔记——Cha3.2.3改变布局参数实现View的滑动
查看>>
python闭包与装饰器
查看>>
Acegi 源码解释
查看>>
Activity的几种启动跳转方式
查看>>
LCA最近公共祖先Tarjan(离线)
查看>>
牛客练习赛16 E求值
查看>>
matlab rank
查看>>
Asp.net系列--基础篇(三)
查看>>
css基础
查看>>
如何在tomcat中如何部署java EE项目
查看>>
【Python基础教程第2版】——第二讲:列表和元组
查看>>
小常识
查看>>
使用vscode开发python
查看>>
swift--调用系统单例实现打电话
查看>>
0038-算一算是一年中的第几天
查看>>
51nod 1094 【水题】
查看>>
003.第一个动画:绘制直线
查看>>