大网数据广告活动
Web 标准与前端开发

Webkit CSS 扩展

· 52CE 我爱测

基于 WebKit 或 Blink 的应用,例如 Safari 和 Chrome,支持一些特殊的 **CSS WebKit 扩展**。这些扩展通常带有 `-webkit-` 前缀。大多数 `-webkit-` 前缀的属性通常也能够与 `-apple-` 前缀使用。少部分是有 `-epub-` 前缀的。

基于 WebKit 或 Blink 的应用,例如 Safari 和 Chrome,支持一些特殊的 CSS WebKit 扩展。这些扩展通常带有 -webkit- 前缀。大多数 -webkit- 前缀的属性通常也能够与 -apple- 前缀使用。少部分是有 -epub- 前缀的。

仅 WebKit 具有的属性

[!NOTE] 避免在网站上使用。这些属性仅在 WebKit 应用中可用。

A

  • -webkit-animation-trigger
  • -webkit-app-region
  • -webkit-aspect-ratio

B

  • -webkit-backdrop-filter
  • border-block-end**
  • border-block-end-color**
  • border-block-end-style**
  • border-block-end-width**
  • border-block-start**
  • border-block-start-color**
  • border-block-start-style**
  • border-block-start-width**
  • border-inline-end**
  • border-inline-end-color**
  • border-inline-end-style**
  • border-inline-end-width**
  • -webkit-border-horizontal-spacing
  • border-inline-start**
  • border-inline-start-color**
  • border-inline-start-style**
  • border-inline-start-width**
  • -webkit-border-vertical-spacing
  • align-items**
  • flex-direction**
  • -webkit-box-flex-group**
  • flex-grow**
  • flex-flow**
  • order**
  • flex-direction**
  • justify-content**
  • -webkit-box-reflect**

C

  • -webkit-column-axis
  • -webkit-column-break-after
  • -webkit-column-break-before
  • -webkit-column-break-inside
  • -webkit-column-progression
  • -webkit-cursor-visibility

D-I

  • -webkit-dashboard-region
  • -webkit-font-size-delta
  • font-smooth
  • -webkit-hyphenate-character
  • -webkit-hyphenate-limit-after
  • -webkit-hyphenate-limit-before
  • -webkit-hyphenate-limit-lines
  • -webkit-initial-letter

L

  • -webkit-line-align
  • -webkit-line-box-contain
  • -webkit-line-clamp
  • -webkit-line-grid
  • -webkit-line-snap
  • -webkit-locale
  • -webkit-logical-height
  • -webkit-logical-width

M

  • -webkit-margin-after
  • -webkit-margin-before
  • margin-block-end**
  • margin-block-start**
  • -webkit-marquee-direction
  • -webkit-marquee-increment
  • -webkit-marquee-repetition
  • -webkit-marquee-speed
  • -webkit-marquee-style
  • -webkit-marquee
  • -webkit-mask-box-image-outset
  • -webkit-mask-box-image-repeat
  • -webkit-mask-box-image-slice
  • -webkit-mask-box-image-source
  • -webkit-mask-box-image-width
  • -webkit-mask-box-image
  • -webkit-mask-repeat-x***
  • -webkit-mask-repeat-y***
  • -webkit-mask-source-type
  • -webkit-mask-position-x
  • -webkit-mask-position-y
  • -webkit-max-logical-height
  • -webkit-max-logical-width
  • -webkit-min-logical-height
  • -webkit-min-logical-width

N

  • -webkit-nbsp-mode

P

  • padding-block-end**
  • padding-block-start**
  • padding-inline-end**
  • padding-inline-start**
  • -webkit-perspective-origin-x
  • -webkit-perspective-origin-y

R-S

  • -webkit-rtl-ordering
  • -webkit-svg-shadow

T

  • -webkit-tap-highlight-color
  • -webkit-text-decoration-skip
  • -webkit-text-decorations-in-effect
  • -webkit-text-fill-color
  • -webkit-text-security
  • -webkit-text-stroke-color
  • -webkit-text-stroke-width
  • -webkit-text-stroke
  • -webkit-text-zoom
  • -webkit-transform-origin-x
  • -webkit-transform-origin-y
  • -webkit-transform-origin-z

U

  • -webkit-user-drag
  • -webkit-user-modify

* 一些是在标准的、无前缀的轨道上。 ** 新语法已经标准化。属性链接到新的语法。旧的带有前缀的语法在一些浏览器中依然支持。 *** WebKit 支持不带 -webkit 前缀,但是不标准或者不在标准轨道上。

标准轨道上的带有 WebKit 前缀的属性

  • appearance
  • -webkit-font-size-delta

已经成为标准属性的前专有属性

[!NOTE] 要尽可能地提高兼容性,你需要使用无前缀的标准属性,而不是下面列出的这些有前缀的。

A

  • align-content
  • align-items
  • align-self
  • animation
  • animation-delay
  • animation-direction
  • animation-duration
  • animation-fill-mode
  • animation-iteration-count
  • animation-name
  • animation-play-state
  • animation-timing-function
  • appearance

B

  • backface-visibility
  • background-clip
  • background-origin
  • background-size
  • border-bottom-left-radius
  • border-bottom-right-radius
  • border-image
  • border-radius
  • border-top-left-radius
  • border-top-right-radius
  • box-decoration-break
  • box-shadow
  • box-sizing

C

  • clip-path
  • column-count
  • column-fill
  • column-gap
  • column-rule
  • column-rule-color
  • column-rule-style
  • column-rule-width
  • column-span
  • column-width
  • columns

F

  • filter
  • flex
  • flex-basis
  • flex-direction
  • flex-flow
  • flex-grow
  • flex-shrink
  • flex-wrap
  • font-feature-settings
  • font-kerning
  • font-variant-ligatures

G-J

  • grid
  • grid-area
  • grid-auto-columns
  • grid-auto-flow
  • grid-auto-rows
  • grid-column
  • grid-column-end
  • column-gap
  • grid-column-start
  • gap
  • grid-row
  • grid-row-end
  • row-gap
  • grid-row-start
  • grid-template
  • grid-template-areas
  • grid-template-columns
  • grid-template-rows

H-L

  • hyphens
  • justify-content
  • justify-items
  • justify-self
  • line-break

M

  • mask
  • mask-clip
  • mask-composite
  • mask-image
  • mask-origin
  • mask-position
  • mask-repeat
  • mask-size

O-R

  • opacity
  • order
  • perspective
  • perspective-origin
  • print-color-adjust
  • ruby-position

S

  • scroll-snap-type
  • shape-image-threshold
  • shape-margin
  • shape-outside

T

  • text-combine-upright
  • text-decoration
  • text-decoration-color
  • text-decoration-line
  • text-decoration-style
  • text-emphasis
  • text-emphasis
  • text-emphasis-color
  • text-emphasis-color
  • text-emphasis-position
  • text-emphasis-style
  • text-emphasis-style
  • text-justify
  • text-orientation
  • text-size-adjust
  • text-underline-position
  • transform
  • transform-origin
  • transform-style
  • transition
  • transition-delay
  • transition-duration
  • transition-property
  • transition-timing-function

U-W

  • user-select
  • word-break
  • writing-mode

在非 webkit 浏览器中不带前缀支持,但是非标准

以下的属性在至少一个浏览器中不带前缀就支持,但是不在标准的轨道上。

  • mask-position-x*
  • mask-position-y*

* 在 Firefox 中不带前缀支持,在 Safari 中带前缀。

在 Firefox 中带 -webkit- 前缀支持

以下属性在 Firefox 中带 -webkit- 前缀支持,其中许多也支持无前缀版本。参见上面的已经成为标准属性的前专有属性。

[!NOTE] 由于许多网站的旧版代码使用了以 -webkit- 为前缀的属性,Edge 和 Firefox 会将许多 -webkit- 为前缀的属性重定向到 -moz-、-ms- 和相应的没有前缀的等价属性上。

A

  • align-content
  • align-items
  • align-self
  • animation
  • animation-delay
  • animation-direction
  • animation-duration
  • animation-fill-mode
  • animation-iteration-count
  • animation-name
  • animation-play-state
  • animation-timing-function
  • appearance*

B

  • backface-visibility
  • background-clip
  • background-origin
  • background-size
  • border-bottom-left-radius
  • border-bottom-right-radius
  • border-image
  • border-radius
  • box-align**, ***
  • box-direction**, ***
  • box-flex**, ***
  • box-orient**, ***
  • box-pack**, ***
  • box-shadow
  • box-sizing
  • border-top-left-radius
  • border-top-right-radius

F

  • filter
  • flex
  • flex-basis
  • flex-direction
  • flex-flow
  • flex-grow
  • flex-shrink
  • flex-wrap

J

  • justify-content

M

  • mask
  • mask-clip
  • -webkit-mask-composite*
  • mask-image
  • mask-origin
  • mask-position
  • -webkit-mask-position-x**
  • -webkit-mask-position-y**
  • mask-repeat
  • mask-size

O-P

  • order
  • perspective
  • perspective-origin

T

  • -webkit-text-fill-color**
  • text-size-adjust
  • -webkit-text-stroke**
  • -webkit-text-stroke-color**
  • -webkit-text-stroke-width**
  • transform
  • transform-origin
  • transition
  • transition-delay
  • transition-duration
  • transition-property
  • transition-timing-function

U

  • user-select

* 在 Firefox 中支持有 -moz- 和 -webkit- 前缀的版本,但是不支持无前缀版本。 ** 这些值是支持的,尽管不是标准的且也不在成为标准的轨道上。 *** 应该使用 flex-box 属性。

弃用的 -webkit- 属性

以下属性曾经带 -webkit- 前缀支持,但是在常新浏览器(evergreen browser)中不再支持,无论有无 -webkit- 前缀。

  • -webkit-alt*
  • -webkit-background-composite
  • -webkit-border-fit
  • -webkit-color-correction
  • -webkit-flow-from
  • -webkit-flow-into
  • -webkit-grid-columns(参见 grid-column)
  • -webkit-grid-rows(参见 grid-row)
  • -webkit-highlight
  • -webkit-hyphenate-charset
  • -webkit-image-set(参见 image/image-set)
  • -webkit-match-nearest-mail-blockquote-color
  • -webkit-margin-collapse
  • -webkit-margin-after-collapse
  • -webkit-margin-before-collapse
  • -webkit-margin-bottom-collapse
  • -webkit-margin-top-collapse
  • -webkit-region-break-after
  • -webkit-region-break-before
  • -webkit-region-break-inside
  • -webkit-region-fragment
  • -webkit-shape-inside
  • -webkit-touch-callout(参见 touch-action)
  • background-origin-x(无前缀!)
  • background-origin-y(无前缀!)

* 仍在 Safari 技术预览版中支持,但是通常在正式发布的浏览器中不支持。

伪类

  • :animating-full-screen-transition
  • :is
  • :any-link*
  • :autofill
  • :autofill-strong-password
  • :drag
  • :full-page-media
  • :full-screen*
  • :full-screen-ancestor
  • :full-screen-document
  • :full-screen-controls-hidden

* 现为标准。

[!NOTE] 如果在选择器的链或组中有一个无效的伪类,那么整个选择器列表都是无效的。

伪元素

由于网页兼容性的原因,Blink、WebKit 和 Gecko 浏览器将所有以 ::-webkit- 开头的伪类都视为有效的。

  • ::file-selector-button*
  • ::-webkit-inner-spin-button
  • ::placeholder
  • ::-webkit-media-controls
  • ::-webkit-media-controls-current-time-display
  • ::-webkit-media-controls-enclosure
  • ::-webkit-media-controls-fullscreen-button
  • ::-webkit-media-controls-mute-button
  • ::-webkit-media-controls-overlay-enclosure
  • ::-webkit-media-controls-panel
  • ::-webkit-media-controls-play-button
  • ::-webkit-media-controls-timeline
  • ::-webkit-media-controls-time-remaining-display
  • ::-webkit-media-controls-toggle-closed-captions-button
  • ::-webkit-media-controls-volume-control-container
  • ::-webkit-media-controls-volume-control-hover-background
  • ::-webkit-media-controls-volume-slider
  • ::-webkit-meter-bar
  • ::-webkit-meter-even-less-good-value
  • ::-webkit-meter-inner-element
  • ::-webkit-meter-optimum-value
  • ::-webkit-meter-suboptimum-value
  • -webkit-media-text-track-container
  • ::-webkit-outer-spin-button
  • ::-webkit-progress-bar
  • ::-webkit-progress-inner-element
  • ::-webkit-progress-value
  • ::-webkit-search-cancel-button
  • ::-webkit-search-results-button
  • ::-webkit-slider-runnable-track
  • ::-webkit-slider-thumb

* 现为标准

[!NOTE] 通常来说,如果在选择器的链或组中有一个无效的伪元素或者伪类,那么整个选择器列表都是无效的。如果伪元素(不是伪类)有 -webkit- 前缀,那么自 Firefox 版本 63 起,Blink、WebKit 和 Gecko 浏览器都假定其为有效的,不会使整个选择器列表无效。

媒体特性

  • @media/-webkit-animation
  • @media/-webkit-device-pixel-ratio
  • @media/-webkit-transform-2d
  • @media/-webkit-transform-3d
  • @media/-webkit-transition

参见

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。