CSS hackä¯ÀÀÆ÷¼æÈÝÒ»ÀÀ±í
CSS hackÊÇÖ¸ÎÒÃÇΪÁ˼æÈݸ÷ä¯ÀÀÆ÷£¬¶øʹÓõÄÌرðµÄcss¶¨Òå¼¼ÇÉ¡£ÕâÊǹúÍâÕªÀ´µÄÒ»ÕÅCSS hackÁÐ±í£¬ÏÔʾÁ˸÷ä¯ÀÀÆ÷¶Ôcss hackµÄÖ§³Ö³Ì¶È£¬¶ÔÎÒÃÇÖÆ×÷¼æÈÝÍøÒ³·Ç³£ÓаïÖú¡£
ÆÁ±ÎIEä¯ÀÀÆ÷£¨Ò²¾ÍÊÇIEϲ»ÏÔʾ£© *:lang(zh) select {font:12px !important;} /*FF,OP¿É¼û£¬ÌرðÌáÐÑ£ºÓÉÓÚOpera×î½üµÄÉý¼¶£¬Ä¿Ç°´Ë¾äֻΪFFËùʶ±ð*/
select:empty {font:12px !important;} /*safari¿É¼û*/
ÕâÀïselectÊÇÑ¡Ôñ·û£¬¸ù¾ÝÇé¿ö¸ü»»¡£µÚ¶þ¾äÊÇMACÉÏsafariä¯ÀÀÆ÷¶ÀÓеġ£ ½öIE7ÓëIE5.0¿ÉÒÔʶ±ð *+html select {…}
µ±ÃæÁÙÐèÒªÖ»Õë¶ÔIE7ÓëIE5.0×öÑùʽµÄʱºò¾Í¿ÉÒÔ²ÉÓÃÕâ¸öHACK¡£ ½öIE7¿ÉÒÔʶ±ð *+html select {…!important;}
µ±ÃæÁÙÐèÒªÖ»Õë¶ÔIE7×öÑùʽµÄʱºò¾Í¿ÉÒÔ²ÉÓÃÕâ¸öHACK¡£ IE6¼°IE6ÒÔÏÂʶ±ð * html select {…}
Õâ¸öµØ·½ÒªÌرð×¢ÒâºÜ¶à²©¿Í¶¼Ð´³ÉÁËÊÇIE6µÄHACKÆäʵIE5.xͬÑù¿ÉÒÔʶ±ðÕâ¸öHACK¡£ÆäËüä¯ÀÀÆ÷²»Ê¶±ð¡£
html/**/ >body select {…}
Õâ¾äÓëÉÏÒ»¾äµÄ×÷ÓÃÏàͬ¡£ ½öIE6²»Ê¶±ð£¬ÆÁ±ÎIE6 select { display /*ÆÁ±ÎIE6*/:none;}
ÕâÀïÖ÷ÒªÊÇͨ¹ýCSS×¢ÊÍ·Ö¿ªÒ»¸öÊôÐÔÓëÖµ£¬×¢ÊÍÔÚðºÅÇ°¡£ ½öIE6ÓëIE5²»Ê¶±ð£¬ÆÁ±ÎIE6ÓëIE5 select/**/ { display /*IE6,IE5²»Ê¶±ð*/:none;}
ÕâÀïÓëÉÏÃæÒ»¾ä²»Í¬µÄÊÇÔÚÑ¡Ôñ·ûÓ뻨À¨ºÅÖ®¼ä¶àÁËÒ»¸öCSS×¢ÊÍ¡£²»ÆÁ±ÎIE5.5 ½öIE5²»Ê¶±ð£¬ÆÁ±ÎIE5 select/*IE5²»Ê¶±ð*/ {…}
ÕâÒ»¾äÊÇÔÚÉÏÒ»¾äÖÐÈ¥µôÁËÊôÐÔÇøµÄ×¢ÊÍ¡£Ö»ÓÐIE5²»Ê¶±ð£¬IE5.5¿ÉÒÔʶ±ð¡£ ºÐÄ£Ðͽâ¾ö·½·¨ selct {width:IE5.x¿í¶È; voice-family :"\"}\""; voice-family:inherit; width:ÕýÈ·¿í¶È;}
ºÐÄ£Ð͵ÄÇå³ý·½·¨²»ÊÇͨ¹ý!importantÀ´´¦ÀíµÄ¡£ÕâµãÒªÃ÷È·¡£ Çå³ý¸¡¶¯ select:after {content:"."; display:block; height:0; clear:both; visibility:hidden;}
ÔÚFirefoxÖУ¬µ±×Ó¼¶¶¼Îª¸¡¶¯Ê±£¬ÄÇô¸¸¼¶µÄ¸ß¶È¾ÍÎÞ·¨ÍêÈ«µÄ°üסÕû¸ö×Ó¼¶£¬ÄÇôÕâʱÓÃÕâ¸öÇå³ý¸¡¶¯µÄHACKÀ´¶Ô¸¸¼¶×öÒ»´Î¶¨Ò壬ÄÇô¾Í¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ¡£ ½Ø×ÖÊ¡ÂԺŠselect { -o-text-overflow:ellipsis; text-overflow:ellipsis; white-space:nowrap; overflow:hidden; }
Õâ¸öÊÇÔÚÔ½³ö³¤¶Èºó»á×ÔÐеĽصô¶à³ö²¿·ÖµÄÎÄ×Ö£¬²¢ÒÔÊ¡ÂԺŽá⣬ºÜºÃµÄÒ»¸ö¼¼Êõ¡£Ö»ÊÇÄ¿Ç°Firefox²¢²»Ö§³Ö¡£ Ö»ÓÐOperaʶ±ð @media all and (min-width: 0px){ select {……} }
Õë¶ÔOperaä¯ÀÀÆ÷×öµ¥¶ÀµÄÉ趨¡£
ÒÔÉ϶¼ÊÇдCSSÖеÄһЩHACK£¬
Ïà¹ØÎĵµ£º
1.Çø±ðIEºÍ·ÇIEä¯ÀÀÆ÷
#tip {
background:blue; /*·ÇIE ±³¾°藍É«*/
background:red \9; /*IE6¡¢IE7¡¢IE8±³¾°紅É«*/
}
2.Çø±ðIE6,IE7,IE8,FF
¡¾Çø±ð·ûºÅ¡¿£º¡¸\9¡¹¡¢¡¸*¡¹¡¢¡¸_¡¹
¡¾Ê¾Àý¡¿£º
#tip {
background:blue; /*Firefox ±³¾°±äÀ¶É«*/
background:r ......
½ñÌìÓöµ½Òª×öCSSʵÏֲ˵¥Ô²½Ç±³¾°µÄЧ¹û, ËùÒÔÔÚÍøÉÏËÑÁËһϣ¬·¢ÏÖ´Ë·½·¨×î¼òµ¥¿ÉÐÐ~~ÌؼǼÏÂÀ´¹©´ó¼ÒÒ»ÆðʹÓÃ~~~
.nav ul li a{float:left; display:block; padding: 0 10px;
} /*×¢Òâpadding*/
.nav ul li a:hover{padding:0 0 0 10px;
display:block; background:url(images/tableft1.jpg) left top no-repeat # ......
CSSÒѾ³ÉΪÍøҳǰ¶ÎÉè¼ÆÒ»¸ö·Ç³£ÖØÒªµÄ²¿·Ö£¬ÓÉÓÚдCSSʱÐèÒª¿¼ÂǵÄÎÊÌâ·Ç³£¶à£¬ÀÏÊÖÃÇ´´½¨ÐÂÒ³ÃæÊÇͨ³£»áÑØÓÃÒÔÇ°µÄCSS¿ò¼Ü¡£µ«ÊÇÐÂÊÖûÓÐ×Ô¼ºµÄ¿ò¼Ü£¬ÕâƪÎÄÕ¿ÉÒÔ¸øÐÂÊÖÃÇһЩÆôʾ¡£
1.¼òµ¥µÄ´¿CSS Tooltip
ͨ¹ýÕâЩ´úÂ룬Äã¿ÉÒÔ×ö³ö¼òµ¥µÄTooltip¡£ÕâÊÇCSS
´úÂ룺
ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º
a:hover { background: ......
±ÈÈçÒª·Ö±æIE6ºÍfirefoxÁ½ÖÖä¯ÀÀÆ÷£¬¿ÉÒÔÕâÑùд£º
¡¡¡¡<style>
¡¡¡¡div{
¡¡¡¡background:green; /* for firefox */
¡¡¡¡*background:red; /* for IE6 */
¡¡¡¡}
¡¡¡¡</style>
¡¡¡¡ÎÒÔÚIE6Öп´µ½ÊǺìÉ«µÄ£¬ÔÚfirefoxÖп´µ½ÊÇÂÌÉ«µÄ¡£
¡¡¡¡½âÊÍһϣº
¡¡¡¡ÉÏÃæµÄcssÔÚfirefoxÖУ¬ËüÊÇÈÏʶ²»Á˺óÃæµÄÄǸö´ ......
¸Õ¿ªÊ¼Ñ§Ï°zend framework £¬¶ÔÓÚ·¾¶ÎÊÌ⻹ÊÇûŪÃ÷°×£¬ÒÔÖÁÓÚͼƬ²»ÄÜÕý³£ÏÔʾ£¬ËѱéÁËGoogleÖÕÓÚÕÒµ½Ò»¸ö½â¾ö°ì·¨¡£¾ßÌå½â¾ö°ì·¨ÈçÏ£º
ÔÚ.htaccessÖÐÓÃÏÂÃæÕâ¶Î´úÂë´úÌæÔÓдúÂë
# Zend Framework rewrite¹æÔò
RewriteEngine on
RewriteCond
%{REQUEST_FILENAME} !-f
RewriteRule .* index.php
#
°²È«ÐÔ¿¼ÂÇ£ ......