HTML5¼¼Êõ

HTML5 ѧϰ×ܽᣨһ£©¡ª¡ªHTML5¸ÅÒªÓëÐÂÔö±êÇ© - ÕŹû(6)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2016-11-29 17:01 ÎÒÒªÆÀÂÛ( )

ʹÓÃsourceÔªËØ×÷Ϊ¶àýÌåÔªËصÄ×Ó±êÇ© Àý: audio source src='test.mp3 type='audio/mpeg'/ source src='test.ogg type='audio/ogg'/ source src='test.spx type='audio/ogg'/ /audio ʹÓÃsourceÔªËØ£¬ä¯ÀÀÆ÷ÔÚÁÐ

ʹÓÃsourceÔªËØ×÷Ϊ¶àýÌåÔªËصÄ×Ó±êÇ©
Àý:
<audio>
<source src='test.mp3’ type='audio/mpeg'/>
<source src='test.ogg’ type='audio/ogg'/>
<source src='test.spx’ type='audio/ogg'/>
</audio>
ʹÓÃsourceÔªËØ£¬ä¯ÀÀÆ÷ÔÚÁбí˳Ðò²éÕÒ£¬Ö±µ½ÕÒµ½Ò»¸öËüÄܲ¥·ÅµÄÎļþ¸ñʽ£¬ÕÒµ½ºó£¬¾Í²¥·Å¸ÃÎļþ²¢ºöÂÔËæºóµÄÆäËüÔªËØ¡£

audioµÄAPIÓëvideo»ù±¾Ò»Ñù£¬ÏÂÃæÊÇÒ»¸ö×Ô¶¨Òåµ÷ÕûÒôÁ¿µÄʾÀý£º

audio±êÇ©audio±êÇ©»»¸öä¯ÀÀÆ÷°É£¬Ì«ÀÏÁË setVolume(obj){ document.getElementById(; }

ÔËÐнá¹û£º

ÒôÁ¿Ö»ÔÚ0-1Ö®¼ä¡£

3.3.3¡¢embedÔªËØ 

ÓÃÀ´Ç¶ÈëÄÚÈÝ(°üÀ¨¸÷ÖÖýÌå)¡£¸ñʽ¿ÉÒÔÊÇMidi¡¢Wav¡¢AIFF¡¢AU¡¢MP3,flashµÈ¡£Àý£º<embed src="flash.swf" /> 
HTML4ÖдúÂëʾÀý<object data="flash.swf" type="application/x-shockwave-flash"><object>

ËÄ¡¢HTML5¼æÈÝÐÔ

ʱÖÁ½ñÈÕ¶àÊýÏÖ´úä¯ÀÀÆ÷¶ÔHTML5µÄÖ§³ÖÒѾ­ºÜ¸ßÁË£¬ÌرðÊÇÒƶ¯¶Ë£¬µ«HTML5»¹ÊÇ´æÔÚijЩ±êÇ©µÄ¼æÈÝÐÔÎÊÌâµÄ£¬Ö»ÒªÊÀ½çÉÏ»¹ÓÐ1¸öÒÔÉϵÄä¯ÀÀÆ÷¾Í»á´æÔÚ¼æÈÝÎÊÌ⣬

4.1¡¢¼æÈÝÐÔ²âÊÔ

1¡¢µ±Ç°ä¯ÀÀÆ÷HTML5Ö§³ÖÇé¿öÔÚÏß²âÊÔ£º

IE8ä¯ÀÀÆ÷£¬µÃ·Ö33·Ö£¬¹²555·Ö

Chromeä¯ÀÀÆ÷£¬54°æ£¬¹²555·Ö£¬µÃ·Ö499·Ö

2¡¢µ±Ç°ä¯ÀÀÆ÷¶ÔHTML5¡¢CSS3µÄÖ§³ÖÇé¿ö£º

3¡¢¸÷¸öä¯ÀÀÆ÷¶ÔHTML5¡¢CSS3Ö§³ÖÇé¿ö´óÈ«£º

¿ÉÒÔÓÃÓÚ²âÊÔÖ¸¶¨µÄHTML£¬CSS3£¬JavaScriptм¼Êõ£¬ÒÔWeb SQL DatabaseµÄÖ§³ÖÇé¿öΪÀý£º

4.2¡¢HTML5ÏòϼæÈÝ 4.2.1¡¢¼æÈݲâÊÔ

ΪµÄ²âÊÔ¼æÈÝÐÔ£¬×öÒ»¸ö¼òµ¥µÄʾÀý£¬½Å±¾ÈçÏ£º

HTML5¼æÈÝ #section1{ height background

IE8ä¯ÀÀЧ¹û£º

Ϊʲô²»ÏÔʾ£¬ÒòΪIE8²»ÈÏʶsectionÕâ¸öHTML5±êÇ©£¬ä¯ÀÀÆ÷²âÊÔ½á¹ûÈçÏ£º

´ÓIE9¿ªÊ¼²Å²¿·ÖÖ§³ÖHTML5ÖеıêÇ©¡£

4.2.2¡¢html5shiv

html5shiv¿ÉÒÔͨ¹ýºÜ¼òµ¥µÄJavaScriptÈÃIE6-IE9ä¯ÀÀÆ÷¶¼Ö§³ÖHTML5ÖеÄÔªËØ
HTML5 ShivÕâ¿ÉÒÔÈþßÓп¼¹Å¼ÛÖµµÄInternet ExplorerÖ§³ÖHTML5Ïà¹ØÔªËØ£¬Í¬Ê±ÎªIE6-9, Safari 4.x (ÒÔ¼°iPhone 3.x), ÒÔ¼°Firefox 3.xÌṩ»ù±¾µÄHTML5Ñùʽ¡£
ÏîÄ¿µØÖ·£ºhttps://github.com/aFarkas/html5shiv

ÏÂÔغóÔÚÒ³ÃæÖÐÒýÈë²å¼þ£¬´úÂëÈçÏ£º

HTML5¼æÈÝ[if lt IE 9]> <script src="js/html5shiv.min.js" type="text/javascript" charset="utf-8"></script> <![endif] #section1 { height background

ÔËÐÐЧ¹û£º

¿ÉÒÔ¿´µ½ÔÚIE8ϾÍÄÜÕý³£Ê¹ÓÃsectionÁË£¬µ«Êǽ¨ÒéÔÚ²»Ö§³ÖHTML5µÄä¯ÀÀÆ÷ÖбÜÃâʹÓÃHTML5±êÇ©£¬¿ÉÒÔÓÃdivÌæ´ú£»

ÁíÍâ²»ÒªÒÔΪʹÓÃÁËÕâ¸ö¼òµ¥µÄ²å¼þºóËùÓеÄHTML5¹¦ÄÜÔÚ²»Ö§³ÖHTML5µÄä¯ÀÀÆ÷Öж¼ÓÐÁË£¬ËüÖ»ÊÇ×öÁ˼òµ¥µÄ¼æÈݹ¦ÄÜ£¬Èç

video±êÇ©ÔÚIE8Öв»ÄÜʹÓã¬Ê¹ÓÃÁ˸òå¼þºóÈÔÈ»²»Äܲ¥·ÅÊÓƵ¡£

4.2.3¡¢Modernizr

Modernizr ÊÇÒ»¸öÓÃÀ´¼ì²âä¯ÀÀÆ÷¹¦ÄÜÖ§³ÖÇé¿öµÄ JavaScript ¿â¡£ Ä¿Ç°£¬Í¨¹ý¼ìÑéä¯ÀÀÆ÷¶ÔһϵÁвâÊԵĴ¦ÀíÇé¿ö£¬Modernizr ¿ÉÒÔ¼ì²â18Ïî CSS3 ¹¦ÄÜÒÔ¼°40¶àÏî¹ØÓÚHTML5 µÄ¹¦ÄÜ¡£ Ëü±È´«Í³¼ì²âä¯ÀÀÆ÷Ãû³Æ£¨ä¯ÀÀÆ÷Ðá̽£©µÄ·½Ê½¸üΪ¿É¿¿¡£ Ò»ÕûÌײâÊÔµÄÖ´ÐÐʱ¼ä½öÐ輸΢Ãë¡£ ´ËÍ⣬Modernizr Íøվͨ¹ý¶¨Öƽű¾Ö»¶ÔÄã¸ÐÐËȤµÄÔªËؽøÐмì²â£¬´Ó¶øʵÏÖЧÂÊÓÅ»¯¡£
https://modernizr.com/

ÕâÀïÒÔCSS3ÖеÄÏßÐÔ½¥±äΪÀý×Ó£¬ÔÚÖ§³ÖCSS3µÄä¯ÀÀÆ÷ʹÓý¥±ä£¬Èç¹û²»Ö§³ÖÔòʹÓÃͼƬ£¬ÏÈÉú³É¼ì²âµÄjs£º

ÒýÈë²å¼þºóµÄ½Å±¾ÈçÏ£º

HTML5¼æÈÝ #div1 { height background .no-cssgradients #div1{ background

 

ʹÓòå¼þºó£¬µ±Ò³ÃæÔËÐÐʱ»á×Ô¶¯¼ì²âä¯ÀÀÆ÷ÊÇ·ñÖ§³Öij¸öÌض¨µÄ¹¦ÄÜ£¬Èç¹ûÖ§³ÖÔò»áÔÚhtml±êÇ©ÉÏÌí¼ÓÒ»¸öÀàÑùʽÈ磺cssgradients,Èç¹û²»Ö§³ÖÔò»áÌí¼ÓÒ»¸öÀàÑùʽ:no-*£¬Èçno-cssgradients¡£ 

Modernizr.video   //ÔÚjsÖÐÅжÏÊÇ·ñÖ§³Övideo±êÇ©

Î塢ʾÀýÏÂÔØ

 Ê¾ÀýÏÂÔØ£ºgithub

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • HTML5ѧϰÓë¹®¹Ì¡ª¡ªcanvas»æͼÏóÆåÅÌ - SeeYouBug

    HTML5ѧϰÓë¹®¹Ì¡ª¡ªcanvas»æͼÏóÆåÅÌ - SeeYouBug

    2016-11-29 18:00

  • CSS3ѧϰ±Ê¼Ç1-Ñ¡ÔñÆ÷ºÍÐÂÔöÊôÐÔ - xinyiyake

    CSS3ѧϰ±Ê¼Ç1-Ñ¡ÔñÆ÷ºÍÐÂÔöÊôÐÔ - xinyiyake

    2016-11-21 17:00

  • HTML5ÖÐÒýÈëµÄ¹Ø¼üÌØÐÔ - ¾ÍÖ»ÊÇСÜø

    HTML5ÖÐÒýÈëµÄ¹Ø¼üÌØÐÔ - ¾ÍÖ»ÊÇСÜø

    2016-11-21 16:00

  • HTML5¡¾Óï·¨Òªµã¡¿ - Kris©b

    HTML5¡¾Óï·¨Òªµã¡¿ - Kris©b

    2016-11-21 12:00

ÍøÓѵãÆÀ
Ç