CSS

图像 | CSS Images

CSS图像

CSS图像是CSS的一个模块,它定义了可以使用何种类型的图像<image>类型,包含URL、渐变和其他类型的图像%29,如何调整它们的大小,以及它们和其他替换的内容如何与不同的布局模型交互。

参照系

特性

  • image-orientation

  • image-rendering

  • object-fit

  • object-position

功能

  • linear-gradient()

  • radial-gradient()

  • repeating-linear-gradient()

  • repeating-radial-gradient()

  • element()%28https://developer.mozilla.org/en-US/docs/web/css/Element%28%29%29

数据类型

  • <image>

  • <uri>

指南

使用CSS梯度显示特定类型的CSS图像,梯度,以及如何创建和使用这些。在CSS中实现图像精灵描述将多个图像组合在一个文档中的常用技术,以保存下载请求并加快页面可用性。

规格

SpecificationStatusComment
CSS Image Values and Replaced Content Module Level 4Working Draft
CSS Image Values and Replaced Content Module Level 3Candidate Recommendation
Compatibility StandardThe definition of 'CSS Gradients' in that specification.Living StandardStandardizes the -webkit prefixed gradient value functions
CSS Values and Units Module Level 3The definition of '<url>' in that specification.Candidate Recommendation
CSS Level 2 (Revision 1)The definition of '<uri>' in that specification.Recommendation
CSS Level 1The definition of '<url>' in that specification.RecommendationInitial definition

浏览器兼容性

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support1.01.0 (1.7 or earlier)(Yes)(Yes)(Yes)

FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support1.01.0 (1)(Yes)(Yes)(Yes)