css ÅжÏä¯ÀÀÆ÷
²»Í¬µÄä¯ÀÀÆ÷ÒªÇó²»Í¬µÄÑùʽÉùÃ÷£¬¸÷ä¯ÀÀÆ÷¼°Æä¸÷°æ±¾Óв»Í¬³Ì¶ÈµÄ CSS Ö´ÐеÄÍêÕûÐÔ¡£²ÉÓõÄÊÇ Internet Explorer µÄÌõ¼þ×¢ÊÍÓï·¨µÄ˼Ï룬²¢°ÑËüÄÚÁªµ½ CSS ÉùÃ÷Ö®ÖС£
¡¡¡¡Ìõ¼þ CSS Ö÷ÒªÓÃÓÚÖ¸³öÒ»¸öÌرðµÄ CSS ÉùÃ÷ÊDz»ÊÇÓ¦¸ÃÓÃÓÚÒ»¸öÌرðµÄä¯ÀÀÆ÷¡£µ±È»Ä㲻ϣÍû¾³£Õâô×ö£¬µ«Êǵ±ÄãÐèÒªÕë¶ÔÒ»¸öä¯ÀÀÆ÷µÄʱºò£¬Ëü»á·Ç³£ÓÐÓ᣿ÉÒÔÔÚU4EAÖ§³ÖÁбíÀï¿´µ½£¬´ó²¿·ÖµÄä¯ÀÀÆ÷¶¼Ö§³ÖÕâÖÖ·½Ê½¡£
¡¡¡¡ÈÎÒâ CSS ÉùÃ÷»òÕ߿鶼¿ÉÒÔÌí¼ÓÌõ¼þÉùÃ÷ǰ׺£¬ÕâЩǰ׺ÓÐ3ÖÖ»ù±¾ÀàÐÍ£º
[if {!} browser] [if {!} browser version] [if {!} condition browser version]
! - ÉùÃ÷µÄ·ñ¶¨ (Àý NOT) - ¿ÉÑ¡
browser - ÉùÃ÷Õë¶ÔµÄä¯ÀÀÆ÷
IE - Internet Explorer
Gecko - Gecko ºËÐĵÄä¯ÀÀÆ÷ (Firefox, Camino µÈ)
Webkit - Webkit ºËÐĵÄä¯ÀÀÆ÷ (Safari, Shiira µÈ)
SafMob - Òƶ¯°æ Safari (iPhone / iPod Touch)
Opera - Opera µÄä¯ÀÀÆ÷
IEMac - Mac °æ±¾µÄ Internet Explorer
Konq - Konqueror
IEmob - Òƶ¯°æ IE
PSP - Playstation Portable
NetF - Net Front
version - ÒªÕë¶ÔµÄä¯ÀÀÆ÷°æ±¾
ʵÀý£º
// Ìõ¼þ-CSS Ó﷨ʵÀý [if IE] - Èç¹ûä¯ÀÀÆ÷ÊÇ IE [if ! Opera] - Èç¹ûä¯ÀÀÆ÷²»ÊÇ Opera [if IE 5] - Èç¹ûä¯ÀÀÆ÷ÊÇ IE 5 [if lte IE 6] - Èç¹ûä¯ÀÀÆ÷ÊÇ IE 6 »òÕ߸üµÍ°æ±¾ (IE 5, IE 4 µÈ) [if !&nb
Ïà¹ØÎĵµ£º
µÚÒ»Õ£ºÓ¦ÖªµÀ
1.1 DIV+CSS
µÄ½Ð·¨ÊDz»×¼È·µÄ
ÎÒÏë·²ÊÇÀ´µ½“Õâ¸öרÌ┵Äͬѧ£¬ºÜ´ó²¿·ÖÊdzå×ÅDIV+CSSÀ´µÄ£¬Ä¿µÄ¾ÍÊÇѧϰ
DIV+CSSµÄ£¬ËµµÄÔÙÖ±½ÓһЩ¾ÍÊÇѧϰÈçºÎÓÃDIV+CSS²¼¾ÖÒ³Ã棬ÈçºÎ´ÓÒ»ÕÅͼƬÖÆ×÷³É±ê×¼µÄDIV+CSSÒ³Ãæ¡£
Èç¹ûÄã¿´ÍêµÚÒ»¶Î»¹Ã»Óз¢ÏÖ´íÎóµÄ»°£¬ÄÇÄã¾ÍºÜÓб ......
ÉϽڿÎÎÒÃǽ²ÁËÒ»ÏÂCssͨ¹ýʲô·½Ê½È¥¿ØÖÆÒ³Ãæ
£¬Èç¹û²»¼ÇµÃ£¬ÎÒÀ´°ï´ó¼Ò»ØÒäһϣ¬×ܹ²ÓÐËÄÖÖ·½Ê½ÐÐÄÚ·½Ê½¡¢ÄÚ
Ƕ·½Ê½¡¢Á´½Ó·½Ê½¡¢µ¼È뷽ʽ£¬´ó¼Òͨ¹ýÕâËÄÖÖ·½Ê½¾Í¿ÉÒÔʵÏÖCSS
¶ÔHTML
Ò³ÃæÑùʽµÄ¿ØÖÆ£¬Èç¹ûÒªÈÃÕâЩÑùʽ¶ÔHTMLÒ³ÃæÖеÄÔªËØʵÏÖÒ»¶ÔÒ»£¬Ò»¶Ô¶à»òÕ߶à¶ÔÒ»µÄ¿ØÖÆ£¬Õâ¾ÍÐè
ÒªÓõ½CSSÑ¡ÔñÆ÷£¬HTMLÒ³ÃæÖеÄÔ ......
×¢ÒâÊÂÏ
ÁËʵÏÖµ¼º½ÖеÄ×Óµ¼º½ÓëÖ÷µ¼º½ÔÚʵÏÖÊó±ê½»»¥µÄͬʱ£¬±£³ÖÆäÏà¶ÔλÖÃÒ»Ö£¬ÎÒÃÇʹÓÃÁ˶Ôul li{}ʹÓÃÁËposition:relative;ʹÆ䶨λ·½Ê½×ªÎªÏà¶Ô¶¨Î»¡£¶ø¶Ôli ul{}¼´×Óµ¼º½²ÉÓÃÁËposition:absolute;Ïà¶ÔÓÚµ¼º½µÄ¾ø¶Ô¶¨Î»·½Ê½£¬ÁËÆäÊó± ......
//»ñÈ¡Ò»¸öÌض¨ÔªËصÄÑùʽÊôÐÔ
function getStyle(elem,name){
//Èç¹û¸ÃÊôÐÔ´æÔÚÓÚstyleÖÐ ÔòËû×î½ü±»ÉèÖùý
if(elem.style[name]){
return elem.style[name];
}
//·ñÔò³¢ÊÔIE·½·¨
else if(elem.currentStyle){
return elem.currentStyle[name];
//W3C·½·¨
}else if(document.defaultview && document ......
¡¡¡¡IE5¼°ÆäÒÔºó°æ±¾Ö§³ÖÔÚCSSÖÐʹÓÃexpression£¬ÓÃÀ´°ÑCSSÊôÐÔºÍJavas cript±í´ïʽ¹ØÁªÆðÀ´£¬ÕâÀïµÄCSSÊôÐÔ¿ÉÒÔÊÇÔªËعÌÓеÄÊôÐÔ£¬Ò²¿ÉÒÔÊÇ×Ô¶¨ÒåÊôÐÔ¡£¾ÍÊÇ˵CSSÊôÐÔºóÃæ¿ÉÒÔÊÇÒ»¶ÎJavas cript±í´ïʽ£¬CSSÊôÐÔµÄÖµµÈÓÚJavas cript±í´ïʽ¼ÆËãµÄ½á¹û¡£ ÔÚ±í´ïʽÖпÉÒÔÖ±½ÓÒýÓÃÔªËØ×ÔÉíµÄÊôÐԺͷ½·¨£¬Ò² ......