亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Attributes accesskey (attribute) class (attribute) contenteditable (attribute) contextmenu (attribute) data-* (attribute) dir (attribute) draggable (attribute) dropzone (attribute) Global attributes hidden (attribute) id (attribute) itemid (attribute) itemprop (attribute) itemref (attribute) itemscope (attribute) itemtype (attribute) lang (attribute) slot (attribute) spellcheck (attribute) style (attribute) tabindex (attribute) title (attribute) translate (attribute) Elements a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 head header hr html i iframe img input input type="button" input type="checkbox" input type="color" input type="date" input type="datetime"-local input type="email" input type="file" input type="hidden" input type="image" input type="month" input type="number" input type="password" input type="radio" input type="range" input type="reset" input type="search" input type="submit" input type="tel" input type="text" input type="time" input type="url" input type="week" ins kbd label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt rtc ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr Miscellaneous Attributes Block-level elements CORS enabled image CORS settings attributes Element Inline elements Kinds of HTML content Link types Microdata Optimizing your pages for speculative parsing Preloading content Reference Supported media formats Using the application cache Obsolete acronym applet basefont big blink center command content dir element font frame frameset hgroup image input type="datetime" isindex keygen listing marquee nextid noframes plaintext strike tt xmp
characters

這是一個(gè)實(shí)驗(yàn)中的功能

由于該技術(shù)的規(guī)格不穩(wěn)定,請查看各種瀏覽器的兼容性表格以供使用。另外請注意,隨著規(guī)范的變化,實(shí)驗(yàn)技術(shù)的語法和行為在未來版本的瀏覽器中可能會(huì)發(fā)生變化。

HTML<picture>元素是一個(gè)容器,用來為其內(nèi)部特定的<img>元素提供多樣的<source>元素。瀏覽器會(huì)根據(jù)當(dāng)前頁面(即圖片所在的盒子的容器)的布局以及當(dāng)前瀏覽的設(shè)備(比如普通的屏幕和高清屏幕)去從中選擇最合適的資源。

內(nèi)容類別


Flow content, phrasing content, embedded content

允許的內(nèi)容

零個(gè)或多個(gè)<source>元素,后跟一個(gè)<img>元素,可選地與腳本支持元素混合在一起。

標(biāo)記遺漏

沒有,起始和結(jié)束標(biāo)簽都是強(qiáng)制性的。

允許父級(jí)

任何允許嵌入內(nèi)容的元素。

允許ARIA角色

沒有

DOM界面

HTMLPictureElement

屬性

這個(gè)元素只包含全局屬性。

示例1:使用該media屬性

media屬性允許你提供一個(gè)用于給用戶代理作為選擇<source>元素的依據(jù)的媒體查詢。如果這個(gè)媒體查詢匹配結(jié)果為false,那么這個(gè)<source>元素會(huì)被跳過。

<picture> <source srcset="mdn-logo-wide.png" media="(min-width: 600px)"> <img src="mdn-logo-narrow.png" alt="MDN"></picture>

示例2:使用該type屬性

type屬性允許你為<source>元素的 srcset 屬性指向的資源指定一個(gè) MIME 類型。如果用戶代理不支持指定的類型,那么這個(gè)<source>元素會(huì)被跳過。

<picture> <source srcset="mdn-logo.svg" type="image/svg+xml"> <img src="mdn-logo.png" alt="MDN"></picture>

規(guī)范

Specification

Status

Comment

WHATWG HTML Living StandardThe definition of '<picture>' in that specification.

Living Standard

Initial definition

瀏覽器兼容性

Feature

Chrome

Edge

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

38

13

38 (38)

No support

25

9.1

Feature

Android

Edge

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

38

(Yes)

38.0 (38)

No support

25

iOS 9.3

Previous article: Next article: