1.ÈÃÀÏʽä¯ÀÀÆ÷Ö§³ÖHTML5
HTML5ÄÜΪÎÒÃÇ×öµÄʶùºÜ¶à£¬×îΪ¿É¿ÚµÄ¾ÍÊÇÓïÒ廯±êÇ©µÄÓ¦Óã¬Èç¹ûÄãÒѾÔÚChrome»òÕßÆäËûÖ§³ÖHTML5µÄä¯ÀÀÆ÷ÉÏÓùýËüµÄÅ£x£¬ÄÇÕâƪÎÄÕ¶ÔÄãÒ»¶¨ÓÐÓã¬ÒòΪÏÖÔÚÄãÒ²¿ÉÒÔÔÚIEÉÏÓõ½HTML5¡£
µÚÒ»ÖÖ·½·¨£ºÊ¹ÓÃGoogleµÄhtml5shiv°ü£¨ÍƼö£©
Ê×ÏÈÄãÒªÒýÓÃÏÂÃæÊÇÒýÓÃGoogleµÄhtml5.jsÎļþ£¬ºÃ´¦¾Í²»ËµÁË£º
1 <!--[if IE]> 2 <script src=””></script>
½«ÉÏ´úÂ븴ÖƵ½head²¿·Ö£¬¼Çסһ¶¨ÒªÊÇhead²¿·Ö£¨ÒòΪIE±ØÐëÔÚÔªËؽâÎöÇ°ÖªµÀÕâ¸öÔªËØ£¬ËùÒÔÕâ¸öjsÎļþ²»ÄÜÔÚÆäËûλÖõ÷Ó㬷ñÔòʧЧ£©
Ö÷ÒªÊÇÈÃÕâЩhtml5±êÇ©³É¿é×´£¬ÏñdivÄÇÑù¡£ºÃÁË£¬¼òµ¥°É£¬Ò»¾ä»°¸ÅÀ¨¾ÍÊÇ£ºÒýÓÃhtml5.js ʹhtml5±êÇ©³É¿é×´
µÚ¶þÖÖ·½·¨£ºCoding JavaScript
1 <!--[if lt IE9]> 2 <script> 3 (function() { 4 if (! 5 /*@cc_on!@*/ 6 0) return; 7 var e = "abbr, article, aside, audio, canvas, datalist, details, dialog, eventsource, figure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video".split(', '); 8 var i= e.length; 9 while (i--){ 10 document.createElement(e[i]) 11 } 12 })() 13 </script>
µ«ÊDz»¹ÜʹÓÃÒÔÉÏÄÄÖÖ·½·¨,¶¼Òª³õʼ»¯Ð±êÇ©µÄCSS.ÒòΪHTML5ÔÚĬÈÏÇé¿öϱíÏÖΪÄÚÁªÔªËØ£¬¶ÔÕâЩԪËؽøÐв¼¾ÖÎÒÃÇÐèÒªÀûÓÃCSSÊÖ¹¤°ÑËüÃÇתΪ¿é×´ÔªËØ·½±ã²¼¾Ö
1 /*html5*/ 2 article,aside,dialog,footer,header,section,footer,nav,figure,menu{display:block}
µ«ÊÇÈç¹ûie6/7/8 ½ûÓýű¾µÄÓû§,ÄÇô¾Í±ä³ÉÁËÎÞÑùʽµÄ"°×°å"ÍøÒ³,ÎÒÃǸÃÔõô½â¾öÄØ?
ÎÒÃÇ¿ÉÒÔ²ÎÕÕfacebookµÄ×ö·¨£¬¼´Òýµ¼Óû§½øÈë´øÓÐnoscript±êʶµÄ “/?_fb_noscript=1”Ò³Ã棬Óà html4 ±êÇ©Ìæ»» html5 ±êÇ©£¬ÕâÒª±ÈΪÁ˱£³Ö¼æÈÝÐÔ¶øд´óÁ¿ hack µÄ×ö·¨¸üÇá±ãһЩ¡£
1 <!--[if lte IE 8]> 2 <noscript> 3 <style>.html5-wrappers{display:none!important;}</style> 4 <div>ÄúµÄä¯ÀÀÆ÷½ûÓÃÁ˽ű¾£¬Çë<a href="">²é¿´ÕâÀï</a>À´ÆôÓýű¾!»òÕß<a href="/?noscript=1">¼ÌÐø·ÃÎÊ</a>. 5 </div> 6 </noscript>
ÕâÑù¿ÉÒÔÒýµ¼Óû§¿ªÆô½Å±¾,»òÕßÖ±½ÓÌøתµ½HTML4±êÇ©Éè¼ÆµÄ½çÃæ¡£
2.ÈÃÀÏʽä¯ÀÀÆ÷¼æÈÝCSS3£¨²»ÍêÈ«¼æÈÝ·½°¸£©
µ½Internet Explorer 8Ϊֹ£¬IEϵÁÐÊDz»Ö§³ÖCSS3µÄ¡£ÔÚIEÖÐÒª×öһЩ³£ÓõÄЧ¹ûÈçÔ²½Ç¡¢ÒõÓ°£¬¾ÍÐèÒªÓÃһЩÈßÓà¶øÎÞÒâÒåµÄÔªËغÍͼƬÀ´×ö³öÕâЩЧ¹û¡£ÔÚÑá¾ëÕâЩºó£¬¾Í Ïë×ÅÓøüΪ¼ò½à¡¢Ö±½ÓÓÐЧ¡¢CSS3ʽµÄ°ì·¨À´½â¾öÕâЩÎÊÌâ¡£ºÃÔÚ¾ÍËãÊDZ¥ÊÜÅúÆÀµÄInternet Explorer£¬Æä±¾ÉíÒ²ÊÇ×㹻ǿ´óµÄ¡£IEÌØÓеļ¼Êõ¿ÉÒԺܺõÄʵÏÖһЩCSS3µÄЧ¹û¡£
Opacity͸Ã÷¶È
ÔªËصÄ͸Ã÷¶ÈÔÚIEÖпÉÒԺܷ½±ãµÄÓÃÂ˾µÀ´ÊµÏÖ¡£
1 background-color:green; 2 opacity: .4; 3 filter:progid:DXImageTransform.Microsoft.alpha(opacity=40);
ÕâÀï°ë͸Ã÷ÇøÓò
opacity: .4;
filter:alpha(opacity=40);
border-radiusÔ²½Ç/Box ShadowºÐÒõÓ°/Text ShadowÎÄ×ÖÒõÓ°
ÔÚIEÖпÉÒÔÀûÓÃVector Markup Language (VML)ºÍjavascriptÀ´ÊµÏÖÕâЩЧ¹û£¬²Î¼ûIE-CSS3£¬ÔÚÒýÓÃÁËÒ»¸öHTCÎļþºó£¬ÔÚIEä¯ÀÀÆ÷ÖоͿÉÒÔʹÓÃÕâÈýÖÖCSS3ÊôÐÔÁË¡£
1 -moz-border-radius: 15px; /* Firefox */ 2 -webkit-border-radius: 15px; /* Safari ¡¢Chrome */ 3 border-radius: 15px; /* Opera 10.5+, IE6+ ʹÓà IE-CSS3*/ 4 -moz-box-shadow: 5px 5px 5px #000; /* Firefox */ 5 -webkit-box-shadow: 5px 5px 5px #000; /* Safari¡¢Chrome */ 6 box-shadow: 5px 5px 50px #000; /* Opera 10.5+£¬IE6+ ʹÓà IE-CSS3 */ 7 behavior: url(ie-css3.htc); /*ÒýÓÃie-css3.htc */
ʵ¼ÊÉÏ£¬ÔÚIEÖÐÓÐ×Ô¼ºµÄÂ˾µÀ´ÊµÏÖÒõÓ°(shadow)ºÍͶӰ(drop-shadow)Ч¹ûµÄ
shadow»á²úÉúÁ¬Ðø¡¢½¥±äµÄÒõÓ°
1 filter: progid:DXImageTransform.Microsoft.Shadow(color='#000000', Direction=145, Strength=10);
drop-shadow²úÉúµÄÒõӰûÓÐÃ÷°µ±ä»¯
1 filter:progid:DXImageTransform.Microsoft.DropShadow(Color="#6699CC",OffX="5",OffY="5",Positive="1");
Â˾µËƺõºÍÏÖÓеÄhtc½Å±¾ÓгåÍ»£¬»òÕß¿ÉÒÔ³Æ֮ΪÌØÐÔ£ºÁ½ÕßͬʱÔÚÒ»¸öÔªËØÉÏÆôÓõÄʱºò£¬Â˾µÐ§¹û»áתÒƵ½Æä×ÓÔªËØÉÏ
¡¡