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

CSSÍêÃÀ¼æÈÝIE6/IE7/FFµÄͨÓ÷½·¨

Ò»¡¢CSS HACK
ÒÔÏÂÁ½ÖÖ·½·¨¼¸ºõÄܽâ¾öÏÖ½ñËùÓÐHACK.
1, !important
Ëæ×ÅIE7¶Ô!importantµÄÖ§³Ö, !important ·½·¨ÏÖÔÚÖ»Õë¶ÔIE6µÄHACK.(×¢Òâд·¨.¼ÇµÃ¸ÃÉùÃ÷λÖÃÐèÒªÌáÇ°.)
<style>
#wrapper
{
width: 100px!important; /* IE7+FF */
width: 80px; /* IE6 */
}
</style>
2, IE6/IE77¶ÔFireFox
*+html Óë *html ÊÇIEÌØÓеıêÇ©, firefox Ôݲ»Ö§³Ö.¶ø*+html ÓÖΪ IE7ÌØÓбêÇ©.
<style>
#wrapper
{
#wrapper { width: 120px; } /* FireFox */
*html #wrapper { width: 80px;} /* ie6 fixed */
*+html #wrapper { width: 60px;} /* ie7 fixed, ×¢Òâ˳Ðò */
}
</style>
×¢Òâ:
*+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" ¼´¿É,ÂÅÊÔ²»Ë¬.
<style>
/* 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 */
</style>
Èý¡¢ÆäËû¼æÈݼ¼ÇÉ
1, FFϸø div ÉèÖà padding ºó»áµ¼Ö width ºÍ height Ôö¼Ó, µ«IE²»»á.(¿ÉÓÃ!important½â¾ö)
2, ¾ÓÖÐÎÊÌâ.
1).´¹Ö±¾ÓÖÐ.½« line-height ÉèÖÃΪ µ±Ç° div ÏàͬµÄ¸ß¶È, ÔÙͨ¹ý vertical-align: middle.( ×¢ÒâÄÚÈݲ»Òª»»ÐÐ.)
2).ˮƽ¾ÓÖÐ. margin: 0 auto;(µ±È»²»ÊÇÍòÄÜ)
3, ÈôÐè¸ø a ±êÇ©ÄÚÄÚÈݼÓÉÏ Ñùʽ, ÐèÒªÉèÖà display: block;(³£¼ûÓÚµ¼º½±êÇ©)
4, FF ºÍ IE ¶Ô BOX Àí½âµÄ²îÒìµ¼ÖÂÏà²î 2px µÄ»¹ÓÐÉèΪ floatµÄdivÔÚieÏ margin¼Ó±¶µÈÎÊÌâ.
5, ul ±êÇ©ÔÚ FF ÏÂÃæĬÈÏÓÐ list-style ºÍ padding . ×îºÃÊÂÏÈÉùÃ÷, ÒÔ±ÜÃâ²»±ØÒªµÄÂé·³. (³£¼ûÓÚµ¼º½±êÇ©ºÍÄÚÈÝÁбí)
6, ×÷ΪÍⲿ wrapper µÄ div ²»Òª¶¨ËÀ¸ß¶È, ×îºÃ»¹¼ÓÉÏ overflow: hidden.ÒÔ´ïµ½¸ß¶È×ÔÊÊÓ¦.
7, ¹ØÓÚÊÖÐιâ±ê. cursor: pointer. ¶øhand Ö»ÊÊÓÃÓÚ IE.
1 Õë¶Ôfirefox ie6 ie7µÄcssÑùʽ
ÏÖÔڴ󲿷ֶ¼ÊÇÓÃ!importantÀ´hack£¬¶ÔÓÚie6ºÍfirefox²âÊÔ¿ÉÒÔÕý³£ÏÔʾ£¬
µ


Ïà¹ØÎĵµ£º

¡¾Ê®Ì쾫ͨdiv+css²¼¾ÖϵÁн̡̳¿Ö®Áù£ºXHTML´úÂë¹æ·¶

1.ËùÓеıê¼Ç¶¼±ØÐëÒªÓÐÒ»¸öÏàÓ¦µÄ½áÊø±ê¼Ç
¡¡¡¡ÒÔÇ°ÔÚHTMLÖУ¬Äã¿ÉÒÔ´ò¿ªÐí¶à±êÇ©£¬ÀýÈç<p>ºÍ<li>¶ø²»Ò»¶¨Ð´¶ÔÓ¦µÄ</p>ºÍ</li>À´¹Ø±ÕËüÃÇ¡£µ«ÔÚXHTMLÖÐÕâÊDz»ºÏ·¨µÄ¡£XHTMLÒªÇóÓÐÑϽ÷µÄ½á¹¹£¬ËùÓбêÇ©±ØÐë¹Ø±Õ¡£Èç¹ûÊǵ¥¶À²»³É¶ÔµÄ±êÇ©£¬ÔÚ±êÇ©×îºó¼ÓÒ»¸ö"/"À´¹Ø±ÕËü¡£ÀýÈç:
¡¡¡¡<br />&l ......

DIV+CSS²¼¾Ö¶ÔseoÓÐÄÄЩӰÏ죿£¿


SEOÖ÷Òª¾ÍÊÇͨ¹ý¶ÔÍøÕ¾µÄ½á¹¹£¬±êÇ©£¬ÅÅ°æµÈ¸÷·½ÃæµÄÓÅ»¯£¬Ê¹GoogleµÈËÑË÷ÒýÇæ¸üÈÝÒ×ËÑË÷ÍøÕ¾µÄÄÚÈÝ£¬²¢ÇÒÈÃÍøÕ¾µÄ¸÷¸öÍøÒ³ÔÚGOOGLEµÈËÑË÷ÒýÇæÖлñµÃ½Ï¸ßµÄÆÀ·Ö£¬´Ó¶ø»ñµÃ½ÏºÃµÄÅÅÃû¡£DIV+CSSÍøÒ³²¼¾Ö¶ÔSEOÓÐÄÄЩӰÏìÄØ£¿´úÂ뾫¼òʹÓÃDIV+CSS²¼¾Ö£¬Ò³Ãæ´úÂ뾫¼ò£¬ÕâÒ»µãÏàÐŶÔXHTMLÓÐËùÁ˽âµÄ¶¼ÖªµÀ¡£´úÂ뾫¼òËù´øÀ´µÄÖ±½ ......

cssʵÏÖÎÞͼƬÈý½ÇÐδ¹Ö±µ¼º½Ìõ

Ч¹ûÈçÏ£º
ǰ̨´úÂ룺
   <div id="Men">
            <a href ="addnewbooks.aspx" target="_blank"><span class="left"></span>Ôö¼ÓÐÂÊé<span class="right"></span></a>
    &nb ......

ÎÒдdiv+css¹ý³Ì

ÕâÊÇÔ­ÏÈÎÒдµÄ ±¸ÍüµÄ ¾¡¹ÜдµÄºÜÀÃ
frame.css
Java´úÂë
CHARSET "UTF-°Ë";
html,body{
margin: Áãpx;
padding: Áãpx;
height: 100%;
/*font-size: 12px;
color: #666666;
background: #ffffff;*/
}
*{
margin: Áãpx;
padding: Áãpx;
}
/*ÓÉÓÚÓÃÁËÏà¶ÔλÖøñ¾Ö£¬Ó¦·Ö±æÂÊÌ«´óʱ£¬Í¼Æ¬ºÍÎÄ ......

IEºÍFirefoxÔÚcss,JavaScript·½ÃæµÄ¼æÈÝÐÔ

1.document.formName.item("itemName") ÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»òdocument.formName.elements["elementName"];FirefoxÏÂ,Ö»ÄÜʹÓÃdocument.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃ() ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ