CSS¼æÈÝIE6,IE7,FireFoxÖ®Ò»
¹ØÓÚCSS¶Ô¸÷¸öä¯ÀÀÆ÷¼æÈÝÊǸö·Ç³£ÈÃÈËÍ·ÌÛµÄÊÂÇéÁË, ÍøÂçÉϵĽ̳̱éµØ¶¼ÊÇ.½ñÌìÔÚdiscuz.netÉÏ·¢ÏÖÁËһƪ²»´íµÄ¶«Î÷£¬¾ÍתÔعýÀ´ºÍ´ó¼Ò¹²Ïí.¿ÉÒÔµ±×÷CSS¼æÈÝIE6,IE7,FireFoxµä·¶ÁË£¬ÖµµÃÈ¥¼Ç¼Ï¡£·¢ÏÖ×Ô¼ººÜ¾ÃûÓÐתÔض«Î÷¡£
×¢£ºIE¶¼ÄÜʶ±ð*;±ê×¼ä¯ÀÀÆ÷(ÈçFirefox,Opera,Netscape)²»ÄÜʶ±ð*£»IE6ÄÜʶ±ð*£¬µ«²»ÄÜʶ±ð !important,IE7ÄÜʶ±ð*£¬Ò²ÄÜʶ±ð!important;FF²»ÄÜʶ±ð*£¬µ«ÄÜʶ±ð!important;
дÁ½¾ä´úÂëÀ´¿ØÖÆÒ»¸öÊôÐÔ£¬Çø±ðFirefoxÓëIE6£º
background:orange;*background:blue;
//ÕâÒ»¾ä´úÂëд³öÀ´Ê±£¬ÄãÓÃfirefox»òÆäËü·ÇIEä¯ÀÀʱ£¬»á·¢ÏÖ£¬Ð´Á˸ôúÂëµÄÇøÓò±³¾°ÊdzÈÉ«µÄ£¬Èç¹ûÓÃIEä¯ÀÀ£¬È´ÊÇÀ¶É«µÄ£¬ÕâÊÇÒòΪIE¶¼ÄÜʶ±ð*;±ê×¼ä¯ÀÀÆ÷(ÈçFirefox,Opera,Netscape)²»ÄÜʶ±ð*£»
дÁ½¾ä´úÂëÀ´¿ØÖÆÒ»¸öÊôÐÔ£¬Çø±ðIE7ÓëIE6£º
background:green !important;background:blue;
//ÕâÒ»¾ä´úÂëд³öÀ´Ê±£¬ÄãÓÃIE7ä¯ÀÀ£¬»á·¢ÏÖ£¬Ð´Á˸ôúÂëµÄÇøÓò±³¾°ÊÇÂÌÉ«µÄ£¬Èç¹ûÓÃIE6ä¯ÀÀ£¬È´ÊÇÀ¶É«µÄ£¬ÕâÊÇÒòΪIE7ÄÜʶ±ð!
important*£¬Ò»µ«Ê¶±ðÁË£¬¾ÍÖ´ÐУ¬ºöÂÔÁ˺óÃæµÄÄÇÒ»¾ä£¬µ«IE6È´²»ÄÜʶ±ð!important£¬ËùÒÔÇ°Ã沿·ÖÌø¹ý£¬Ö±½ÓÖ´ÐÐÁ˺ó°ë²¿·Ý¡£
дÁ½¾ä´úÂëÀ´¿ØÖÆÒ»¸öÊôÐÔ£¬Çø±ðFirefoxÓëIE£º
background:orange; *background:green;
//ÕâÒ»¾ä´úÂëд³öÀ´Ê±£¬ÄãÓÃFirefoxä¯ÀÀ£¬»á·¢ÏÖ±³¾°ÊdzÈÉ«µÄ£¬¶øIEÀïÈ´ÊÇÂÌÉ«µÄ£¬ºÜ¼òµ¥£¬ÒòΪFirefox²»ÄÜʶ±ð*£¬¶øIE6£¬IE7¶¼¿ÉÒÔʶ*
дÈý¾ä´úÂëÀ´¿ØÖÆÒ»¸öÊôÐÔ£¬Çø±ðFirefox£¬IE7£¬IE6£º
background:orange;*background:green !important;*background:blue;
//ÕâÒ»¾ä»áʹÔÚFirefoxÔÚ£¬±³¾°³Ê³ÈÉ«£¬IE7ÖÐΪÂÌÉ«£¬IE6ÖÐΪÀ¶É«£¬µÀÀíºÍÇ°ÃæÒ»Ñù£¬Firefox²»ÄÜʶ±ð*£¬ËùÒÔºóÃæÁ½¾ä¶¼²»Ö´
ÐУ¬Ö±½ÓÖ´ÐеÚÒ»¾ä£¬IE7µ±È»Ò²ÄÜÖ´ÐеÚÒ»ÐдúÂ룬µ«ÊÇÒòΪµÚ¶þ¾ä£¬ËûÒ²ÄÜʶ±ð£¬ËùÒÔ¾ÍÖ´ÐÐÁ˵ڶþ¾ä´úÂ룬°ÑÇ°ÃæµÄЧ¹û¸ø¹ýÂËÁË£¬¶ø×îºóÒ»¾ä£¬IE7ÊÇ
²»ÄÜʶ±ðµÄ¡£IE6²»ÄÜʶ±ð!imprtant£¬±¾À´ÔËÐÐÁ˵ÚÒ»¾ä´úÂëÁË£¬µÚ¶þ¾ä²»ÄÜʶ±ð£¬ÄǾÍÀíËùµ±È»µÄÖ´ÐÐÁË×îºóÒ»¾ä¡£
×¢ÒâÊÂÏ
¡¡¡¡1¡¢floatµÄdivÒ»¶¨Òª±ÕºÏ¡£
¡¡¡¡ÀýÈ磺(ÆäÖÐfloatA¡¢floatBµÄÊôÐÔÒѾÉèÖÃΪfloat:left;)
< #div id="floatA" >
< #div id="floatB" >
< #div id="NOTfloatC" >
¡¡¡¡ÕâÀïµÄNOTfloatC²¢²»Ï£Íû¼ÌÐøƽÒÆ£¬¶øÊÇÏ£ÍûÍùÏÂÅÅ¡£
¡¡¡¡Õâ¶Î´úÂëÔÚIEÖкÁÎÞÎÊÌ⣬ÎÊÌâ³öÔÚFF¡£ÔÒòÊÇNOTfloatC²¢·
Ïà¹ØÎĵµ£º
.styleName{
color
:
#FFF
;
/* FF,OP,IE8 */
[
;
color:
#0F0
;
]
/* Sa,CH */
*
color
:
#FF0
;
/* IE7 */
_color:
#F00
;
/* IE6 */
}
.styleName{
background-color
:
#332200
;
/* FF*/
}
html*
.styleName{
background-color
:
#FF00FF
;
/* Sa IE7 CH */
}
*+
html .style ......
½ñÌìÏÂÎ磬ÊÖÍ·ÉÏûʲôÊÂ×ö£¬ÓÚÊǾÍÉÏÍø²é¿´×ÊÁÏ£¬¿´µ½ºÜ¶àÈËдµÄYUI CompressorµÄʹÓ÷½·¨£¬´óÖÂдµÄ¶¼²»Ïêϸ£¬ÓÚÊÇ×Ô¼ºÀ´×ö¸ö×ܽᡣ
£¨1£©Ê×ÏÈÀ´¿´Ï£¬ÎªÊ²Ã´ÒªÑ¹Ëõjs»òcssÎļþ£¿
JS/CSSÎļþ´ó£¬Óû§·ÃÎÊÕ¾µãµÄʱºòÐèÒªÏÂÔØJS/CSSµÄʱ¼ä³¤¾Í»á¸Ð¾õÂý£¬ÓеÄÉõÖÁÓÉÓÚCSSµÄÎļþ¶øÔì³ÉÒ³Ãæ³õʼ´ò¿ªºÜÁèÂÒ¡ ......
ÔÎÄÍøÖ·£ºhttp://www.complexspiral.com/publications
Containing Floats
As powerful and useful as they are, floats can make for tricky layout tools. Chances are that you may have seen something like the situation shown in Figure 1, which is accomplished with just two div elements, each with a floate ......