¡¡¡¡½üÆÚÔÚʹÓÃbootstrapÕâ¸öÓÅÐãµÄÇ°¶Ë¿ò¼Ü£¬Õâ¸ö¿ò¼Ü·Ç³£Ç¿´ó£¬¿ò¼ÜÀïÃæÓÐÏÂÀ²Ëµ¥¡¢°´Å¥×é¡¢°´Å¥ÏÂÀ²Ëµ¥¡¢µ¼º½¡¢µ¼º½Ìõ¡¢Ãæ°üм¡¢·ÖÒ³¡¢ÅÅ°æ¡¢ËõÂÔͼ¡¢¾¯¸æ¶Ô»°¿ò¡¢½ø¶ÈÌõ¡¢Ã½Ìå¶ÔÏóµÈ,bootstrap¶¼ÒѾԤÏȶ¨ÒåºÃÁË£¬µ±ÎÒÃÇÖÆ×÷ÍøÒ³ÉÏ£¬Ö»ÐèÖ±½Óµ÷ÓÃÀïÃæµÄcss¼´¿É
¡¡¡¡bootstrapÊÇÒ»¸öÏìӦʽµÄ²¼¾Ö£¬Äã¿ÉÒÔÔÚ¿íÆÁµçÄÔ¡¢ÆÕͨµçÄÔ£¬Æ½°åµçÄÔ£¬ÊÖ»úÉ϶¼µÃµ½·Ç³£ÓÅÐãµÄ²¼¾ÖÌåÑé¡£ÕâÖÖÏìӦʽµÄ²¼¾ÖÕýÊÇͨ¹ýCSS3µÄýÌå²éѯ£¨Media Query£©¹¦ÄÜʵÏֵģ¬¸ù¾Ý²»Í¬µÄ·Ö±æÂÊÀ´Æ¥Å䲻ͬµÄÑùʽ¡£IE8ä¯ÀÀÆ÷²¢²»Ö§³ÖÕâÒ»ÓÅÐãµÄCss3ÌØÐÔ£¬BootstrapÔÚ¿ª·¢ÎĵµÖÐдÁËÈçºÎʹÓýøÐмæÈÝIE8,Èç¹ûÏë¼æÈÝIE6,IE7£¬¿ÉÒÔËÑË÷bsie (bootstrap2)
¡¡¡¡BootstrapÔÚIE8Öп϶¨²»ÈçChrome¡¢Firefox¡¢IE11ÄÇôÍêÃÀ£¬²¿·Ö×é¼þ²»±£Ö¤ÍêÈ«¼æÈÝ£¬»¹ÊÇÒªHackµÄ
1¡¢Ê¹ÓÃhtml5ÉùÃ÷
<!DOCTYPE html> ÕâÀï²»¿ÉÒÔÓпոñ <html>
×¢£ºÐ´³É<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">ÊDz»¿ÉÐеÄ
2¡¢¼ÓÈëmeta±êÇ©
È·¶¨ÏÔʾ´ËÍøÒ³µÄIE°æ±¾
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=9" />
×¢:bootstrap²»Ö§³ÖIE¼æÈÝģʽ£¬ÎªÁËÈÃIEä¯ÀÀÆ÷ÔËÐÐ×îеÄäÖȾģʽ£¬½«Ìí¼ÓÒÔÉϱêÇ©ÔÚÒ³ÃæÖУ¬IE=edge±íʾǿÖÆʹÓÃIE×îÐÂÄںˣ¬chrome=1±íʾÈç¹û°²×°ÁËÕë¶ÔIE6/7/8µÈ°æ±¾µÄä¯ÀÀÆ÷²å¼þGoogle Chrome Frame
3¡¢ÒýÈëbootstrapÎļþ
<link href="css/bootstrap/bootstrap.min.css">
4¡¢ÒýÈëhtml5shiv.min.jsºÍrespond.min.js
¡¡ Èò»£¨ÍêÈ«£©Ö§³Öhtml5µÄä¯ÀÀÆ÷“Ö§³Ö”html5±êÇ©
<!--[if lt IE 9]> <script src="js/bootstrap/html5shiv.min.js"></script> <script src="js/bootstrap/respond.min.js"></script> <![endif]-->
5¡¢Ìí¼Ó1.X°æ±¾µÄJquery¿â
<script src="js/bootstrap/jquery-1.12.0.min.js"></script>
6¡¢ÔÚIE8ϲâÊÔ£¬·¢ÏÖÒ»¸öÎÊÌâplaceholder²»±»Ö§³Ö£¬ÏÂÃæÊǽâ¾öIEÖ§³ÖplaceholderµÄ·½·¨£¬±¾ÎÄÒýÓõÄjqueryÊÇ1.12.0²âÊÔͨ¹ý£¬ÏÈÒýÓÃjquery
<script type="text/javascript" src="js/bootstrap/jquery-1.12.0.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script>
Ò²¿ÉÒÔÓÃÆäËûµÄjquery°æ±¾£¬ÔÙÒýÈë
<script type="text/javascript" src="js/bootstrap/jquery.placeholder.js"></script>
È»ºóÔÚÎļþÖмÓÈëһϴúÂë
<script type="text/javascript"> $(function () { $('input, textarea').placeholder(); }); </script>
´úÂë×ܽáÈçÏ£º
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" /> <meta content="zhy" /> <title>ie8</title> <link href="css/bootstrap/bootstrap.min.css"> <!--[if lte IE 9]> <script src=js/bootstrap/respond.min.js"></script> <script src=js/bootstrap/html5shiv.min.js"></script> <![endif]--> <script src="js/bootstrap/jquery-1.12.0.min.js"></script> <script src="js/bootstrap/bootstrap.min.js"></script> </head> <body> </body> </html>
¸½×¢£º
1¡¢IEÏÂÅжÏIE°æ±¾µÄÓï¾ä
<!--[if lte IE 6]> <![endif]--> IE6¼°ÆäÒÔÏ°汾¿É¼û <!--[if lte IE 7]> <![endif]--> IE7¼°ÆäÒÔÏ°汾¿É¼û <!--[if IE 6]> <![endif]--> Ö»ÓÐIE6°æ±¾¿É¼û <![if !IE]> <![endif]> ³ýÁËIEÒÔÍâµÄ°æ±¾ <!--[if lt IE 8]> <![endif]--> IE8ÒÔϵİ汾¿É¼û <!--[if gte IE 7]> <![endif]--> IE7¼°´óÓÚIE7µÄ°æ±¾¿É¼û
lte£º¾ÍÊÇLess than or equal toµÄ¼òд£¬Ò²¾ÍÊÇСÓÚ»òµÈÓÚµÄÒâ˼¡£
lt £º¾ÍÊÇLess thanµÄ¼òд£¬Ò²¾ÍÊÇСÓÚµÄÒâ˼¡£
gte£º¾ÍÊÇGreater than or equal toµÄ¼òд£¬Ò²¾ÍÊÇ´óÓÚ»òµÈÓÚµÄÒâ˼¡£
gt £º¾ÍÊÇGreater thanµÄ¼òд£¬Ò²¾ÍÊÇ´óÓÚµÄÒâ˼¡£
!
£º ¾ÍÊDz»µÈÓÚµÄÒâ˼£¬¸újavascriptÀïµÄ²»µÈÓÚÅжϷûÏàͬ
2¡¢bootstrap3Ïà¹Øcss¡¢js
¡¡ ÏÂÔصØÖ·:
jquery.placeholder.jsÎļþµÄÏÂÔصØÖ·https://github.com/mathiasbynens/jquery-placeholder
¡¡