簡體   English   中英

Firefox圖片標簽支持嗎?

[英]Firefox picture tag support?

我正在嘗試在Firefox中使用picture標簽。 caniuse.com說該picture受Firefox 33(測試版)支持,我可以手動啟用Firefox 32(當前)支持。

從html5rocks打開了一個示例,可以看到它不起作用。 我也嘗試了自己的http://vm-0.krasulya.kd.io/ webinspector網絡面板中僅對基本圖像( src屬性)有請求。

這兩個示例都可以在Chrome Canary中使用。

根據http://www.whatwg.org/specs/web-apps/current-work/multipage/edits.html#the-picture-element HTML是正確的。

FF完全支持picture嗎?

UPD

這是我的標記:

<picture>
    <source
        src="1.jpg"
        type="image/jpeg"
        media="(min-width: 300px)"
        srcset="1.jpg, 2.jpg 2x"/>
  <img 
    src="1.jpg" 
    srcset="1.jpg, 2.jpg 2x">
</picture>

在Firefox中,默認情況下仍然突然禁用scrset屬性(甚至是Nightly,請參見Bug#870021 )。 要啟用它,請轉到about:config並將dom.image.srcset.enabled值設置為true

這是測試頁面: http : //pepelsbey.net/pres/picture/demos/retina.html

還有layout.css.devPixelsPerPx標志,可以將其設置為2.0以在非視網膜設備上測試視網膜。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM