ÍøÕ¾±ä³É»ÒºÚÉ« css ´úÂë
µØÕð ÍøÕ¾±ä³É»ÒºÚÉ« css ´úÂë
5.19-5.21Ϊȫ¹ú°§µ¿ÈÕ£¬ °Ù¶È¡¢ÍøÒס¢ÐÂÀ˵ȸ÷´óÍøÕ¾¾ù±ä³ÉÁ˻ҺÚÉ«ÍøÒ³¡£ÔõÑùʹÍøÒ³±ä³É»ÒºÚÉ«ÄØ£¿
¹úÎñÔº¾ö¶¨5ÔÂ19ÈÕÖÁ21ÈÕΪȫ¹ú°§µ¿ÈÕΪ·½±ãÕ¾µã°§µ¿£¬ÌØÌṩcssÂ˾µ´úÂ룬ÒÔ±í°§µ¿¡£ÒÔÏÂΪȫվCSS´úÂë¡£
html {...}{ filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
ʹÓ÷½·¨£ºÕâ¶Î´úÂë¿ÉÒÔ±äÍøҳΪºÚ°×£¬½«´úÂë¼Óµ½CSS×¶Ë¾Í¿ÉÒÔʵÏÖËØ×°¡£½¨ÒéÈ«¹úÕ¾³¤¶¯ÆðÀ´¡£ÎªÔÚµØÕðÖÐÓöÄѵÄͬ°û°§µ¿¡£
Èç¹ûÍøվûÓÐʹÓÃCSS£¬¿ÉÒÔÔÚÍøÒ³/Ä£°åµÄHTML´úÂë<head>ºÍ</head> Ö®¼ä²åÈ룺
<style>...
html{...}{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);}
</style>
ÓÐһЩվ³¤µÄÍøÕ¾¿ÉÄÜʹÓÃÕâ¸öcss ²»ÄÜÉúЧ£¬ÊÇÒòΪÍøվûÓÐʹÓÃ×îеÄÍøÒ³±ê×¼ÐÒé
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Ç뽫ÍøÒ³×îÍ·²¿µÄ<html>Ì滻ΪÒÔÉÏ´úÂë¡£
ÓÐһЩÍøÕ¾FLASH¶¯»µÄÑÕÉ«²»Äܱ»CSSÂ˾µ¿ØÖÆ£¬¿ÉÒÔÔÚFLASH´úÂëµÄ<object …>ºÍ</object>Ö®¼ä²åÈ룺
×î¼òµ¥µÄ°ÑÒ³Ãæ±ä³É»ÒÉ«µÄ´úÂëÊÇÔÚhead Ö®¼ä¼Ó
<style type="text/css">...
html {...}{
FILTER: gray
}
</style>
Ïà¹ØÎĵµ£º
ÕâÊÇÒ»¸ö±ê×¼µÄCSSÏÂÀ²Ëµ¥ÖÆ×÷½Ì³Ì£¬ÓÐÕë¶ÔÄ¿Ç°Á÷ÐеÄIE6/IE7/IE8²»Í¬°æ±¾µÄCSS´úÂ룬Òò´Ë¿ÉÒÔÔÚIEÖ®¼äÍêÈ«¼æÈÝ£¬²»¹ýÆäËüµÄä¯ÀÀÆ÷Ïñ»ðºü/GGä¯ÀÀÆ÷Ö®ÀàµÄûÓвâÊÔ£¬Èç¹û¼æÈÝIE8µÄ»°£¬ÄÇô¼æÈÝ»ðºüÓ¦¸ÃÎÊÌâ²»´ó°É¡£²Ëµ¥Ê¹ÓÃÀ¶É«»ùµ÷£¬»¬Ïò¶þ¼¶²Ëµ¥¸ü»»±³¾°£¬²Ù×÷µÄ¸Ð¾õºÜÊæ·þ¡£
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XH ......
ÍøÒ³ÖÆ×÷ÖУ¬ÎªÁË·½±ãÈÕºóÐ޸ĻòÐ×÷¿ª·¢£¬³£³£Òª¶ÔÒ³Ãæ½øÐÐÏàÓ¦µÄ×¢ÊÍ£¬ÄãÍøÒ³½á¹¹ÇåÎú£¬¿É¶ÁÐÔÔöÇ¿¡£ÒÔϽéÉܼ¸ÖÖ³£ÓõÄ×¢ÊÍ·½·¨£º
Ò»¡¢HTMLµÄ×¢ÊÍ·½·¨
<!-- html×¢ÊÍ:START -->
ÄÚÈÝ
<!-- html×¢ÊÍ:END -->
¶þ¡¢CSSµÄ×¢ÊÍ·½·¨
<style type="text/css">
/* css×¢ÊÍ*/
</style>
ÔÚµ¥¶À ......
IEºÍFF¶ÔºÐÄ£Ð͵ĽâÊÍÇø±ð
IEºÍFF¶ÔºÐÄ£Ð͵ĽâÊÍÒ²²»Ò»Ñù£¬´úÂë˵Ã÷£º#test { width: 650px !important;width: 648px;padding-left:2px;background:#fff; }
test ÏÔʾµÄ¿í´øÊÇ 650px
IE BoxµÄ×Ü¿í¶ÈÊÇ£º width+padding+border+margin¿í¶È×ܺÍ
FF BoxµÄ×Ü¿í¶È¾ÍÊÇ widthµÄ¿í¶È£¬padding+border+marginµÄ¿í¶ÈÔÚº¬ÔÚwidthÄ ......