MozTW 討論區
https://forum.moztw.org/

令無法載入的圖片像IE顯示成一個叉的方法?
https://forum.moztw.org/viewtopic.php?f=2&t=24788
1 頁 (共 2 頁)

發表人:  Merci chao [ 2008-10-20, 21:09 ]
文章主題 :  令無法載入的圖片像IE顯示成一個叉的方法?

如圖:
圖檔
就是想要顯示這個東西

附加檔案:
sshot-1.png [1.38 KiB]
被下載 492 次

發表人:  余弘兵 [ 2008-10-20, 21:18 ]
文章主題 : 

:shock: (汗)
其實這個東西一看上去就煩躁了 :twisted:

發表人:  Coopoo [ 2008-10-20, 23:28 ]
文章主題 : 


Firefox 安裝目錄\res\broken-image.gif
換成你想要的檔案。
記得要用 16x16 的圖片。

我試了一下,大概就像附加檔案的圖片一樣,框線以及框線到圖片的距離會跟 IE 的不太一樣就是,這我就不知道該怎麼改了。

另外請問一下,該怎麼把附加檔案的圖片直接貼上來呢? 謝謝。

附加檔案:
2008-10-20_232525.gif [1.24 KiB]
被下載 574 次

發表人:  Coopoo [ 2008-10-20, 23:31 ]
文章主題 : 

余弘兵 寫:
:shock: (汗)
其實這個東西一看上去就煩躁了 :twisted:

畫個 rein 風格的叉應該會很漂亮。 :P

發表人:  Holy [ 2008-10-21, 00:03 ]
文章主題 : 

Coopoo 寫:
另外請問一下,該怎麼把附加檔案的圖片直接貼上來呢? 謝謝。

新增附加檔案後,點『發表的附加檔案清單』按鈕,即可複製該檔案之鏈結網址。

發表人:  Coopoo [ 2008-10-21, 00:18 ]
文章主題 : 

Holy 寫:
新增附加檔案後,點『發表的附加檔案清單』按鈕,即可複製該檔案之鏈結網址。

謝謝,可是我點下去以後,只有看到檔案的名稱,圖片網址也還是
download.php?id=8615

發表人:  Holy [ 2008-10-21, 01:10 ]
文章主題 : 

Coopoo 寫:
謝謝,可是我點下去以後,只有看到檔案的名稱,圖片網址也還是
download.php?id=8615

疑?我看確實是真實鏈結啊@@?
圖檔
圖檔

附加檔案:
2008-10-21.png [10.81 KiB]
被下載 371 次
2008-10-20.gif [1.24 KiB]
被下載 360 次

發表人:  Coopoo [ 2008-10-21, 01:45 ]
文章主題 : 

Holy 寫:
疑?我看確實是真實鏈結啊@@?

哎呀呀,剛剛為了不要重上傳檔案,所以是在編輯文章看已經上傳的檔案,如果新增檔案的確是可以的。

謝謝囉。

發表人:  Merci chao [ 2008-10-22, 12:53 ]
文章主題 : 

Coopoo 寫:

Firefox 安裝目錄\res\broken-image.gif
換成你想要的檔案。
記得要用 16x16 的圖片。

我試了一下,大概就像附加檔案的圖片一樣,框線以及框線到圖片的距離會跟 IE 的不太一樣就是,這我就不知道該怎麼改了。
但改了之後, 還是不能看到效果...
例如這個, 這一篇本來是有一張圖片的, 我在 FTP 裏把圖片刪掉了, 現在看根本不知道有圖片 :shock:
圖檔

余弘兵 寫:
:shock: (汗)
其實這個東西一看上去就煩躁了 :twisted:
對於我來說就可不是了
有個記號, 起碼能告訴我這本來是有圖片但我看不到, 而不是看起來這啥都沒有

附加檔案:
sshot-2.png [8.68 KiB]
被下載 361 次

發表人:  Coopoo [ 2008-10-23, 01:05 ]
文章主題 : 

Merci chao 寫:
但改了之後, 還是不能看到效果...
例如這個, 這一篇本來是有一張圖片的, 我在 FTP 裏把圖片刪掉了, 現在看根本不知道有圖片 :shock:

如果只是想要有在死圖沒有 alt 的時候,顯示死圖的標誌。
那Firefox 本身就有了,也就是原本的 broken-image.gif。

但是你的 Firefox 不會這麼做........ Orz

所以也許你需要開個新設定擋或是檢查 browser.display.force_inline_alttext 的值。

http://kb.mozillazine.org/Firefox_:_FAQ ... ig_Entries
引言回覆:
True: Force broken images' alt text to be displayed inline
False (default): Show an icon if rendering in Quirks Mode and there is no alt text, or if rendering in Quirks Mode and the image has a size specified.

發表人:  coolcd [ 2008-10-23, 01:44 ]
文章主題 : 

Coopoo 寫:
Merci chao 寫:
但改了之後, 還是不能看到效果...
例如這個, 這一篇本來是有一張圖片的, 我在 FTP 裏把圖片刪掉了, 現在看根本不知道有圖片 :shock:

如果只是想要有在死圖沒有 alt 的時候,顯示死圖的標誌。
那Firefox 本身就有了,也就是原本的 broken-image.gif。

但是你的 Firefox 不會這麼做........ Orz

所以也許你需要開個新設定擋或是檢查 browser.display.force_inline_alttext 的值。

http://kb.mozillazine.org/Firefox_:_FAQ ... ig_Entries
引言回覆:
True: Force broken images' alt text to be displayed inline
False (default): Show an icon if rendering in Quirks Mode and there is no alt text, or if rendering in Quirks Mode and the image has a size specified.

我測試了一下,好像只有在 "quirks mode" 才會顯示那個死圖的圖示。(要進入 quirks mode,把 doctype 刪掉即可)

發表人:  Coopoo [ 2008-10-23, 03:30 ]
文章主題 : 

剛剛 Google 了一下,有人寫了一個 script 強迫 Firefox 顯示 placeholder。
http://ericulous.com/2008/02/12/greasem ... ng-images/
也許會有用。
coolcd 寫:
我測試了一下,好像只有在 "quirks mode" 才會顯示那個死圖的圖示。(要進入 quirks mode,把 doctype 刪掉即可)

去翻了一下才知道 MozTW 是用 HTML 4.01 Strict,所以沒有顯示 broken-image.gif 才是符合標準的?

HTML 4.01
引言回覆:
The alt attribute must be specified for the IMG and AREA elements. It is optional for the INPUT and APPLET elements.

引言回覆:
User agents must render alternate text when they cannot support images, they cannot support a certain image type or when they are configured not to display images.

這是沒有顯示 placeholder 的原因嗎?

可是 User Agent Accessibility Guidelines 1.0 又寫 user agents 可以自己擺一個 placeholder。
引言回覆:
When a specification does not explain how to provide access to this content, do so as follows:

* If C is a summary, title, alternative, description, or expansion of another piece of content D, provide access through at least one of the following mechanisms:
    o (1a) render C in place of D;
    o (2a) render C in addition to D;
    o (3a) provide access to C by allowing the user to query D. In this case, the user agent must also alert the user, on a per-element basis, to the existence of C (so that the user knows to query D); and
    o (4a) allow the user to follow a link to C from the context of D.
* Otherwise, provide access to C through at least one of the following mechanisms:
    o (1b) render a placeholder for C, and allow the user to view the original author-supplied content associated with each placeholder;
    o (2b) provide access to C by query (e.g., allow the user to query an element for its attributes). In this case, the user agent must also alert the user, on a per-element basis, to the existence of C; and
    o (3b) allow the user to follow a link in context to C.


所以為什麼 Strict mode 不能顯示 placeholder 呢?

發表人:  coolcd [ 2008-10-23, 12:21 ]
文章主題 : 

引言回覆:
  • If C is a summary, title, alternative, description, or expansion of another piece of content D, provide access through at least one of the following mechanisms:
    ...
      (1a) render C in place of D;
    ...
  • Otherwise, provide access to C through at least one of the following mechanisms:

      (1b) render a placeholder for C, and allow the user to view the original author-supplied content associated with each placeholder;
    ...

 C = alt
 D = img

 alt 算是 img 的 alternative description 吧,所以是第一種情形。

 使用非 quirks 的 dtd 時,沒有 alt 的時候,就完全不顯示,因為,在標準網頁中,沒有加 alt 說明文字的,可能是比較不重要的圖,使用文字型瀏覽器的人看不到也沒關係?

 反過來想,不屬於內容的圖 (例如:背景、邊框圖),沒有 alt 屬性或 alt="",那圖的來源有問題時,不會顯示破圖的圖示,這看起來好像會比較清爽。

 補充一點,前面提過的 Show Missing Images 有 addon 版,不需 greasemonkey 也能用。

發表人:  Coopoo [ 2008-10-23, 14:29 ]
文章主題 : 

coolcd 寫:
 C = alt
 D = img

 alt 算是 img 的 alternative description 吧,所以是第一種情形。


我以為是不做第一種就要做第二種,兩種都選一個這樣。

coolcd 寫:
 使用非 quirks 的 dtd 時,沒有 alt 的時候,就完全不顯示,因為,在標準網頁中,沒有加 alt 說明文字的,可能是比較不重要的圖,使用文字型瀏覽器的人看不到也沒關係?

 反過來想,不屬於內容的圖 (例如:背景、邊框圖),沒有 alt 屬性或 alt="",那圖的來源有問題時,不會顯示破圖的圖示,這看起來好像會比較清爽。

HTML5 draft 才明訂空白的 alt,不過也許 MozTW 應該幫討論區的圖片加上 alt (像是檔案名稱)。

發表人:  coolcd [ 2008-10-23, 17:06 ]
文章主題 : 

查了一下才發現這已是 8 年的老問題了,還蠻有爭議的樣子。 Orz

https://bugzilla.mozilla.org/show_bug.cgi?id=41924

1 頁 (共 2 頁) 所有顯示的時間為 UTC + 8 小時
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/