-moz-force-broken-image-icon

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Thuộc tính CSS mở rộng -moz-force-broken-image-icon có thể được dùng để buộc biểu tượng ảnh bị hỏng hiển thị ngay cả khi ảnh bị hỏng có thuộc tính alt.

Cú pháp

css
-moz-force-broken-image-icon: 1;
-moz-force-broken-image-icon: 0;

/* Global values */
-moz-force-broken-image-icon: inherit;
-moz-force-broken-image-icon: initial;
-moz-force-broken-image-icon: revert;
-moz-force-broken-image-icon: revert-layer;
-moz-force-broken-image-icon: unset;

Giá trị

<integer>

Giá trị 1 nghĩa là biểu tượng ảnh bị hỏng được hiển thị ngay cả khi ảnh có thuộc tính alt. Khi dùng giá trị 0, ảnh sẽ hoạt động bình thường và chỉ hiển thị thuộc tính alt.

Note: Ngay cả khi giá trị được đặt thành 1, thuộc tính alt vẫn sẽ được hiển thị, cùng với biểu tượng ảnh bị hỏng.

Định nghĩa chính thức

Initial value0
Applies toimages
Inheritedno
Computed valueas specified
Animation typediscrete

Cú pháp chính thức

-moz-force-broken-image-icon = 
<integer>

<integer> =
<number-token>

Ví dụ

HTML

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

CSS

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

Kết quả

Note: Văn bản alt có thể không hiển thị nếu -moz-force-broken-image-icon được đặt thành 1 và ảnh không có (hoặc có quá nhỏ) height hay width.

Ghi chú

  • Thuộc tính này chỉ hoạt động trên các trình duyệt dựa trên Gecko.
  • Không khuyến nghị sử dụng thuộc tính này. Thay vào đó nên dùng thuộc tính alt phù hợp.

Thông số kỹ thuật

Không thuộc về bất kỳ tiêu chuẩn nào.

Tương thích trình duyệt

Xem thêm