非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

-moz-force-broken-image-icon extended CSS property can be used to force the broken image icon to be shown even when a broken image has an alt 属性。

句法

<integer>
A value of 1 means that the broken image icon is shown even if the image has an alt attribute. When the value 0 is used the image will act as usual and only display the alt 属性。
注意: Even if the value is set to 1 the alt attribute will still be displayed, alongside the broken image icon.

形式定义

初始值 0
适用于 images
继承 no
计算值 如指定
动画类型 discrete

形式句法

<integer>
					

范例

HTML

<img src='/broken/image/link.png' alt='Broken image link'>
					

CSS

img {
  -moz-force-broken-image-icon: 1;
  height: 100px;
  width: 100px;
}
					

结果

Screenshot Live sample
注意: Unless the image has a specified height and width the broken image icon will not be displayed but the alt attribute will also be hidden if -moz-force-broken-image-icon is set to 1 .

注意事项

  • This property will only work in Gecko-based browsers.
  • The use of this property is not recommended. A proper alt attribute should be used instead.

规范

Not part of any standard.

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
-moz-force-broken-image-icon 弃用 非标 Chrome 不支持 No Edge 不支持 No Firefox 完整支持 1 IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 完整支持 4 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

另请参阅

元数据

  • 最后修改: