ÍøÒ³ÖÐÈçºÎ»»·ô£¿£¨CSS£©
×î¼òµ¥µÄ°ì·¨£º¼ÙÉèÄãÓÐÁ½¸öÑÕÉ«µÄCSSÎļþred.css,green.css,ĬÈÏΪºìÉ«µÄÑùʽ
<link rel="stylesheet" style="text/css" link="red.css" id="colorcss">
<input type="button" name="redcss" value='ºìÉ«' onclick="javascript:document.getElementById('colorcss').href='red.css'">
<input type="button" name="greencss" value='ÂÌÉ«' onclick="javascript:document.getElementById('colorcss').href='green.css'">
Äã¿ÉÒÔн¨Ò»¸öHTMLÎĵµ£¬°ÑÒÔÏÂÄÚÈݸ´ÖƵ½ÀïÃ棬ÔÚä¯ÀÀÆ÷Öв鿴Ч¹û£º
<html>
<head>
<style type="text/css">
.style1{background-color:red;}
.style2{background-color:green;}
</style>
</head>
<body>
<div class="style1">abcdfdsfsd</div>
<a href="#" onclick="document.getElementsByTagName('div')[0].className = 'style1'">style1</a>
<a href="#" onclick="document.getElementsByTagName('div')[0].className = 'style2'">style2</a>
</body>
</html>
Ïà¹ØÎĵµ£º
CSS Hack ÊÇÔÚ±ê×¼ CSS û°ì·¨¼æÈݸ÷ä¯ÀÀÆ÷ÏÔʾЧ¹ûʱ²Å»áÓÃÉϵIJ¹¾È·½·¨,ÔÚ¸÷ä¯ÀÀÆ÷³§É̽âÎö CSS ûÓдï³ÉÒ»ÖÂÇ°,ÎÒÃÇÖ»ÄÜÓÃÕâÑùµÄ·½·¨À´Íê³ÉÕâÑùµÄÈÎÎñ¡£ÍøÉÏÄã¿ÉÄÜÄÜËÑË÷µ½Ò»´ó¶ÑµÄ CSS Hack£¬µ«ÊÇÎÒ½ñÌì·¢²¼µÄÄã¿ÉÄܲ¢²»¶¼ºÜÁ˽⣬ÒòΪÕâЩ¶¼ÊÇÖ»Õë¶Ôµ¥¶ÀÒ»¸öä¯ÀÀÆ÷µÄ CSS Hack¡£
ΪÁËÏòÄãչʾÕâЩ CSS Hack ÊÇ·ñÕý³£Ô ......
ÔÎÄÁ´½Ó ×÷Õߣºâø·É
¾¡¹ÜÓÐ CSS µÄ vertical-align ÌØÐÔ£¬µ«ÊDz¢²»ÄÜÓÐЧ½â¾öδ֪¸ß¶ÈµÄ´¹Ö±¾ÓÖÐÎÊÌ⣨ÔÚÒ»¸ö DIV ±êÇ©ÀïÓÐδ֪¸ß¶ÈµÄÎı¾»òͼƬµÄÇé¿öÏ£©¡£
±ê ×¼ä¯ÀÀÆ÷Èç Mozilla, Opera, Safari µÈ.£¬¿É½«¸¸¼¶ÔªËØÏÔʾ·½Ê½É趨Ϊ TABLE(display: table;) £¬ÄÚ²¿×ÓÔªËض¨Îª table-cell (display: table-cell)£¬Í¨¹ý ......
1 Ò³Ãæ²¼¾ÖÓë¹æ»®
2 дÈëÕûÌå²ã½á¹¹ÓëCSS
3 Ò³Ã涥²¿ÖÆ×÷Ö®Ò»
4 Ò³Ã涥²¿ÖÆ×÷Ö®¶þ
5 Ò³ÃæÖÆ×÷-ÓúÃborderºÍclear
ÔÚÍøÒ³ÖÆ×÷ÖУ¬ÓÐÐí¶àµÄÊõÓÀýÈ磺CSS¡¢HTML¡¢DHTML¡¢XHTMLµÈµÈ¡£ÔÚÏÂÃæµÄÎÄÕÂÖÐÎÒÃǽ«»áÓõ½Ò»Ð©ÓйØÓÚHTMLµÄ»ù±¾ÖªÊ¶£¬¶øÔÚÄãѧϰÕâƪÈëÃŽ̳Ì֮ǰ£¬ÇëÈ·¶¨ÄãÒѾ¾ßÓÐ ......