10¸ö·Ç³£ÓÐÓõÄCSS¼¼ÇÉ
1. ½«ÍøÒ³»òÔªËؾÓÖÐ
HTML£º
<div class="wrap">
</div><!-- end wrap -->
CSS£º
.wrap { width:960px; margin:0 auto;}
2.Sticky Footer (ÈÃÒ³½ÅÓÀԶͣ¿¿ÔÚÒ³Ãæµ×²¿£¬¶ø²»ÊǸù¾Ý¾ø¶ÔλÖÃ)
HTML£º
<div id="wrap">
<div id="main" class="clearfix">
</div>
</div>
<div id="footer">
</div>
CSS£º
* { margin:0; padding:0; }
html, body, #wrap { height: 100%; }
body > #wrap {height: auto; min-height: 100%;}
#main { padding-bottom: 150px; } /* must be same height as the footer */
#footer {
position: relative;
margin-top: -150px; /* negative value of footer height */
height: 150px;
clear:both;}
/* CLEAR FIX*/
.clearfix:after {content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;}
.clearfix {display: inline-block;}
/* Hides from IE-mac */
* html .clearfix { height: 1%;}
.clearfix {display: block;}
/* End&nb
Ïà¹ØÎĵµ£º
Ч¹ûÈçÏ£º
ʵÏÖ·½·¨£ºÀûÓÃÒ»ÏÂÁ½ÕÅͼƬ£º
ǰ̨´úÂ룺
<div id="nagivation">
&nb ......
1.¶¨Î»µÄ¶¨Òå
CSSÖж¨Î»ÓÃposition:static|relative|absolute|fixedÀ´ÊµÏÖ
static:1.Õý³£Á÷ÏÔʾ£»2.²»ÄÜͨ¹ýz-index½øÐвãµþ·Ö¼¶£»3.¿ÉÉèÖÃwidth,height£»4.ÉèÖÃtop,right,bottom,leftÎÞЧ
relative:1.²»ÍÑÀëÎĵµÁ÷£¬²Î¿¼×ÔÉíµÄ¾²Ì¬Î»Öã¬Í¨¹ýtop,right,bottom,left½øÐ ......
DOCTYPE Ó°Ïì CSS ´¦Àí
Firefox: div ÉèÖà margin-left, margin-right Ϊ auto ʱÒѾ¾ÓÖÐ, IE ²»ÐÐ
Firefox: body ÉèÖà text-align ʱ, div ÐèÒªÉèÖà margin: auto(Ö÷ÒªÊÇ margin-left,margin-right) ·½¿É¾ÓÖÐ
Firefox: ÉèÖà padding ºó, div »áÔö¼Ó height ºÍ width, µ« IE ²»»á, ¹ÊÐèÒªÓà !important ¶àÉèÒ»¸ö heig ......
Èç¹ûÄãÊÇÍøվǰ¶Ë¿ª·¢ÈËÔ±£¬ÄÇô¶ÔÄãÀ´Ëµ£¬Ò²Ðí×öÒ»¸öƯÁÁµ¼º½²Ëµ¥»áºÜµÃÐÄÓ¦ÊÖ¡£±¾ÎÄҪΪ´ó¼Ò×ܽá¸÷ÖÖµ¼º½²Ëµ¥µÄ×ÊÔ´£¬ÒÔ±ãÈôó¼ÒµÄÍøվǰ¶Ë¿ª·¢µÄ¹¤×÷¸ü
·½±ã¸ü¿ìËÙ£¬Ö»ÒªÑ¡ÔñÏֳɵÄÀý×ӾͿÉÒÔÓ¦ÓÃÓÚ×Ô¼ºµÄÍøÕ¾ÁË¡£±¾ÎÄÊÕ¼¯µÄÕâЩ×ÊÔ´£¬´Ó·Ç³£¼òµ¥µÄHTMLºÍCSSµ¼º½²Ëµ¥£¬µ½·Ç³£¸´ÔӺ͸߼¶µÄ
JQuer ......