Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÓÃJavaScriptÐÞ¸ÄÍøÒ³cssÑùʽ

ÓÃJavaScriptÐÞ¸ÄÍøÒ³Ñùʽ
Ò»¡¢¾Ö²¿¸Ä±äÑùʽ
·ÖΪ¸Ä±äÖ±½ÓÑùʽ£¬¸Ä±äclassNameºÍ¸Ä±äcssTextÈýÖÖ¡£ÐèҪעÒâµÄÊÇ£º
×¢Òâ´óСд
£º
javascript¶Ô´óСдʮ·ÖÃô¸Ð£¬className²»Äܹ»°Ñ“N”д³É“n”£¬cssTextÒ²²»Äܹ»°Ñ“T”д³É“t”£¬·ñÔòÎÞ·¨ÊµÏÖЧ¹û¡£
µ÷Ó÷½·¨
£º
Èç¹û¸Ä±äclassName£¬ÔòÊÂÏÈÔÚÑùʽ±íÖÐÉêÃ÷À࣬µ«µ÷ÓÃʱ²»ÒªÔÙ¸ústyle£¬Ïñdocument.getElementById(’obj’).style.className=”…”µÄд·¨ÊÇ´íÎóµÄ£¡Ö»ÄÜд³É£ºdocument.getElementById(’obj’).className=”…”
¸Ä±äcssText
µ«ÊÇÈç¹ûÓÃcssTextµÄ»°£¬±ØÐë¼ÓÉÏstyle£¬ÕýÈ·µÄд·¨ÊÇ£ºdocument.getElementById(’obj’).style.cssText=”…”
¸Ä±äÖ±½ÓÑùʽÎҾͲ»±Ø˵ÁË£¬´ó¼Ò¼ÇµÃҪдµ½¾ßÌåÑùʽ¼´¿É£¬Èç
document.getElementById(’obj’).style.backgroundColor=”#003366″
¶þ¡¢È«¾Ö¸Ä±äÑùʽ
ͨ³£Çé¿öÏ£¬ÎÒÃÇ¿ÉÒÔͨ¹ý¸Ä±äÍâÁ´ÑùʽµÄµÄhrefµÄֵʵÏÖÍøÒ³ÑùʽµÄʵʱÇл»£¬Ò²¾ÍÊÇ“¸Ä±äÄ£°å·ç¸ñ”¡£ÕâʱºòÎÒÃÇÊ×ÏÈÐèÒª¸³ÓèÐèÒª¸Ä±äµÄÄ¿±êÒ»¸öid£¬Èç
<link rel = "stylesheet" type="text/css" id="css"
href="firefox.css" />
µ÷ÓÃʱºÜ¼òµ¥£¬Èç
<span on
click="javascript:document.getElementById('css').href =
'ie.css'">µãÎҸıäÑùʽ</span>
¶ÔÓÚÐÂÈËÍùÍù²»ÖªµÀCSS¾ßÌåÑùʽÔÚjavascriptÔõôд£¬¶øÇÒÓÐʱºòÔÚ²»Í¬ä¯ÀÀÆ÷ÖÐÒªÇóÒ²²»Ò»Ñù¡£ÈçfloatÔÚIEÖÐд³ÉstyleFloat£¬ÔÚFIREFOXÖÐд³ÉcssFloat£¬Õâ¾ÍÐèÒª´ó¼ÒµÄ»ýÀÛÁË¡£ÔÚgoogleÖÐËÑË÷“ccvita javascript”£¬Ò²Ðí»á¶ÔÄãµÄÒÉ»óÓÐËù°ïÖú¡£
»ù´¡ÖªÊ¶
ͨ³£ÔÚÍøÒ³ÖÐÑùʽ±íµÄµ÷Ó÷½·¨ÓÐÈýÖÖ¡£
µÚÒ»ÖÖ
£ºÁ´ÈëÍⲿÑùʽ±íÎļþ
(Linking to a Style Sheet)
Äã¿ÉÒÔÏȽ¨Á¢ÍⲿÑùʽ±íÎļþ£¨.css£©£¬È»ºóʹÓÃHTMLµÄlink¶ÔÏó¡£Ê¾ÀýÈçÏ£º
<head>
<title>Îĵµ±êÌâ</title>
<link
rel=stylesheet href="http://www.ccvita.com/demo.css"
type="text/css">
</link></head>
¶øÔÚXMLÖУ¬ÄãÓ¦¸ÃÈçÏÂÀýËùʾÔÚÉùÃ÷ÇøÖмÓÈ룺
< ? xml-stylesheet type="text/css"
href="http://www.dhtmlet


Ïà¹ØÎĵµ£º

JavascriptµÄIEºÍFirefox¼æÈÝÐÔ»ã±à

ÒÔÏÂÒÔ IE ´úÌæ Internet Explorer£¬ÒÔ MF ´úÌæ Mozzila Firefox
1. document.form.item ÎÊÌâ
(1)ÏÖÓÐÎÊÌ⣺
ÏÖÓдúÂëÖдæÔÚÐí¶à document.formName.item("itemName") ÕâÑùµÄÓï¾ä£¬²»ÄÜÔÚ MF ÏÂÔËÐÐ
(2)½â¾ö·½·¨£º
¸ÄÓà document.formName.elements["elementName"]
(3)ÆäËü
²Î¼û 2
2. ¼¯ºÏÀà¶ÔÏóÎÊÌâ
(1)ÏÖÓÐÎÊÌ⣠......

Ò»ÌõJavaScriptÓï¾ä»ñÈ¡µ±Ç°ÍøÒ³ËùÓÐͼƬµÄurl


ÔÚµØÖ·À¸ÊäÈ룺
javascript:str='';for%20(var1=0;var1<document.images.length;var1++){str+='\n'+document.images[var1].src};if(str!=''){document.write(str);void(document.close())}else{alert('No%20images!')}
È»ºó²é¿´Ð³öÀ´µÄÒ³ÃæµÄÔ´´úÂë
ÈôÒªÏÔʾ³öÀ´£¬Ôò£º
javascript:funcname='';for%20(var1=0;var ......

IE6/IE7/FFµÄCSS hack ä¯ÀÀÆ÷¼æÈÝ×ܽá

IE6/IE7/FFµÄCSS hack ä¯ÀÀÆ÷¼æÈÝ×ܽá
2010-01-23 15:25
ÓÉÓÚ²»Í¬µÄä¯ÀÀÆ÷¶ÔCSSµÄÖ§³Ö¼°½âÎö½á¹û²»Ò»Ñù£¬´¦ÀíµÄÓÅÏȼ¶²»Ò»Ñù¡£Õë¶Ô²»Í¬µÄä¯ÀÀÆ÷À´Ð´²»Í¬µÄCSS´ïµ½ÔÚ²»Í¬ä¯ÀÀÆ÷ÏÂÏÔʾÏëÒªµÄЧ¹û¾ÍÊÇcss hack¡£ÏÈÌùÁ½¸öÖ±¹ÛµÄ¶Ô±Èͼ£º
ÔÙÌùÒ»¶Î´úÂ룺
#bgcolor {
background:red !important; /* Firefox µÈÆäËûä¯ÀÀÆ÷ * ......

¸÷ä¯ÀÀÆ÷רÊôCSS HACK:FIREFOX/OPERA/SAFARI/IE

CSS Hack ÊÇÔÚ±ê×¼ CSS û°ì·¨¼æÈݸ÷ä¯ÀÀÆ÷ÏÔʾЧ¹ûʱ²Å»áÓÃÉϵIJ¹¾È·½·¨,ÔÚ¸÷ä¯ÀÀÆ÷³§É̽âÎö CSS ûÓдï³ÉÒ»ÖÂÇ°,ÎÒÃÇÖ»ÄÜÓÃÕâÑùµÄ·½·¨À´Íê³ÉÕâÑùµÄÈÎÎñ¡£ÍøÉÏÄã¿ÉÄÜÄÜËÑË÷µ½Ò»´ó¶ÑµÄ CSS Hack£¬µ«ÊÇÎÒ½ñÌì·¢²¼µÄÄã¿ÉÄܲ¢²»¶¼ºÜÁ˽⣬ÒòΪÕâЩ¶¼ÊÇÖ»Õë¶Ôµ¥¶ÀÒ»¸öä¯ÀÀÆ÷µÄ CSS Hack¡£
ΪÁËÏòÄãչʾÕâЩ CSS Hack ÊÇ·ñÕý³£Ô ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ