cssÔÚIE¡¢»ðºüϵļæÈÝÎÊÌâ
DIV£«CSSÍøÒ³²¼¾ÖÕâÊÇÒ»ÖÖÇ÷ÊÆ,ÎÒÒ²¿ªÊ¼Ë³Ó¦Õâ¹ÉÇ÷ÊÆÁË,²»¹ýÔÚʹÓÃDIV£«CSSÍøÕ¾Éè¼ÆµÄʱºò£¬Ó¦¸Ã×¢ÒâcssÑùʽ¼æÈݲ»Í¬ä¯ÀÀÆ÷ÎÊÌ⣬ÌرðÊǶÔÍêȫʹÓÃDIV CSSÉè¼ÆµÄÍøÒ³£¬¾ÍÓ¦¸Ã¸ü×¢ÒâIE6¡¢IE7¡¢FF¶ÔCSSÑùʽµÄ¼æÈÝ£¬²»È»£¬ÄãµÄÍøÒ³¿ÉÄÜÂÒµÄÒ»ËúºýÍ¿£¡ÎÒ¾³£±»ÕâЩ¶«Î÷ÕûµÄ½¹Í·Àöî,ÓÚÊǺôÔÚÍøÉÏÕÒÁËЩ×ÊÁÏ,¼ÓÉÏ×Ô¼ºµÄÀí½âºÍÕâЩÈÕ×ӵľÑé,ÕûÀíÁËһЩ×ÊÁÏ,ÆäÖÐÓÐһЩÎÒ»¹Ã»Óõ½µÄºÍ»¹²»ÄÜÀí½âµÄ,¾ÍÖ±½Ó´Ó±ðµÄµØ·½¸øÕ³Á˹ýÀ´, ²»ÖªµÀÓÐûÓдíÎó,µÈÎÒÒÔºóÓõ½µÄʱºòÂýÂý¸Ä°É,Ï£Íû¶Ô´ó¼ÒÓеã°ïÖú!££ºÃ¾Ñé¹²Ïí½»Á÷Íø
ʲôÊÇä¯ÀÀÆ÷¼æÈÝ£ºµ±ÎÒÃÇʹÓò»Í¬µÄä¯ÀÀÆ÷£¨Firefox IE7 IE6£©·ÃÎÊͬһ¸öÍøÕ¾£¬»òÕßÒ³ÃæµÄʱºò£¬»á³öÏÖһЩ²»¼æÈݵÄÎÊÌ⣬ÔÚÕâÖÖä¯ÀÀÆ÷ÏÂÏÔʾÕý³££¬ÔÚÁíÒ»ÖÖϾÍÂÒÁË£¬ÎÒÃÇÔÚ±àдCSSµÄʱºò»áºÜÄջ𣬸ÕÐÞ¸´ÁËÕâ¸öä¯ÀÀÆ÷µÄÎÊÌ⣬½á¹ûÁíÍâÒ»¸öä¯ÀÀÆ÷È´³öÁËÐÂÎÊÌâ¡£ºÃ°É£¬ÎÒ·þÁËÐаɣ¬ÄÇÎÒ¾ÍÀûÓÃÄãÃǵIJ»¼æÈݸ÷дһ¶Îcss,ÈÃËûÃǸ÷Ö´Ðи÷µÄ£¬ÕâÏÂ×ܸÃÄãûƢÆøÁË°É£¬ºÇºÇ¡£
ºÃÁË£¬ÑÔ¹éÕý´«
×î¼Ñ½â¾ö·½°¸£¬Í¬Ò»¸öÑùʽ¶¨Òå3Ì×£¬Õë¶Ô²»Í¬ä¯ÀÀÆ÷Óã¬Èç#wrapper
#wrapper { width: 120px; } /* FireFox */
*html #wrapper { width: 80px;} /* ie6 fixed */
* html #wrapper { width: 60px;} /* ie7 fixed, ×¢Òâ˳Ðò */
* html Óë *html ÊÇIEÌØÓеıêÇ©£¬firefox Ôݲ»Ö§³Ö¡£
¶ø* html ÓÖΪ IE7ÌØÓбêÇ©¡£
* html ¶ÔIE7µÄHACK ±ØÐë±£Ö¤HTML¶¥²¿ÓÐÈçÏÂÉùÃ÷£º
³ÌÐò´úÂë<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"¡¡"http://www.w3.org/TR/html4/loose.dtd">
¶þ¡¢ÍòÄÜ float ±ÕºÏ
¹ØÓÚ clear float µÄÔÀí¿É²Î¼û [How To Clear Floats Without Structural Markup]
½«ÒÔÏ´úÂë¼ÓÈëGlobal CSS ÖУ¬¸øÐèÒª±ÕºÏµÄdiv¼ÓÉÏ class="clearfix" ¼´¿É£¬ÂÅÊÔ²»Ë¬¡£
³ÌÐò´úÂë
/* Clear Fix */
.clearfix:after
{
content:".";
display:block;
height:0;
clear:both;
visibility:hidden;
}
.clearfix
{
display:inline-block;
}
/* Hide from IE Mac \*/
.clearfix {display:block;}
/* End hide from IE Mac */
/* end of clearfix */
Èý¡¢ÆäËû¼æÈݼ¼ÇÉ
1¡¢FFϸø div ÉèÖà padding ºó»áµ¼Ö width ºÍ height Ôö¼Ó£¬µ«IE²»»á¡££¨¿ÉÓÃ!important½â¾ö£©
2¡¢¾ÓÖÐÎÊÌâ¡£
1) ´¹Ö±¾ÓÖС£½« line-height ÉèÖÃΪ µ±Ç° div ÏàͬµÄ¸ß¶È£¬ÔÙͨ¹ý vertical-align: middle. £¨×¢ÒâÄÚÈݲ»Òª
Ïà¹ØÎĵµ£º
ÔÚtableÖпØÖƵ¥Ôª¸ñÖ®¼äµÄ¼ä¾àÒªÓõ½cellspacing¡¢cellpadding£¬Ä¬ÈÏÇé¿öcellspacing¡¢cellpadding¾ù²»Îª0£¬µ«¾³£µÄ×´¿öΪÁ˲»ÈÃtableµ¥Ôª¸ñÖ®¼äµÄ¼ä¾àÓ°Ïìµ½ÃÀ¹Û£¬ÎÒÃǾ³£»á°Ñcellspacing¡¢cellpaddingÉèÖÃΪ0£¬Òò´Ë¾³£¿´µ½“<table cellspacing=0 cellpadding=0>”ÕâÑùµÄ´úÂë¡£ÕâÑù×öÎÞÐÎÖÐÔö¼ÓÁË´ú ......
½â¾ö·½·¨£º
1¡¢
ÓÃcssÂ˾µ¡£
<td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='bg_img.jpg', sizingMethod='scale'" >
2¡¢
Äã¿ÉÒÔ¿¼ÂÇÓÃcssÂ˾µÀ´×ö±³¾°½¥±äЧ¹û£¬ÉèÖÃtdµÄcss
style="filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#FFFFFF' ......
ÔÚ˵µ½Õâ¸öÎÊÌâµÄʱºò£¬Ò²ÐíÓÐÈË»áÎÊCSSÖв»ÊÇÓÐvertical-alignÊôÐÔÀ´ÉèÖô¹Ö±¾ÓÖеÄÂ𣿼´Ê¹ÊÇijЩä¯ÀÀÆ÷²»Ö§³ÖÎÒÖ»Ðè×öÉÙÐíµÄCSS Hack¼¼Êõ¾Í¿ÉÒÔ°¡£¡ËùÒÔÔÚÕâÀïÎÒ»¹Òª啰àÂÁ½¾ä£¬CSSÖеÄÈ·ÊÇÓÐvertical-alignÊôÐÔ£¬µ«ÊÇËüÖ»¶Ô(X)HTMLÔªËØÖÐÓµÓÐvalignÌØÐÔµÄÔªËزÅÉúЧ£¬ÀýÈç±í¸ñÔªËØÖеģ¼td£¾¡¢£¼th£¾¡¢£¼caption£¾ ......
Jquery¶ÔcssµÄ²Ù×÷Ï൱·½±ã£¬Äܷܺ½±ãÎÒÃÇȥͨ¹ýjsÐÞ¸Äcss¡£´«Í³javascript¶ÔcssµÄ²Ù×÷Ï൱·±Ëö£¬±ÈÈç
<div id="a" style="background:blue">css</div>
È¡ËüµÄbackgroundÓï·¨ÊÇ£º
document.getElementById("a").style.background
¶øjQuery¶Ôcss¸ü·½±ãµÄ²Ù×÷£º
$("#a").background();$("#a").background ......