CSS±Ê¼ÇÖ®¼òд
2009-10-20 13:30:21
¼òдCSSÒ»Ö±±»ÎÒÍü¼Ç£¬Ã»°ì·¨¾ÍËÑÁ˵ã×ÊÁÏ£¬¼Ç¼ÈçÏ£º
font
¼òд£º
font:italic small-caps bold 12px/1.5em arial,verdana;
µÈЧÓÚ£º
font-style:italic;font-variant:small-caps;font-weight:bold;font-size:12px;line-height:1.5em;font-family:arial,verdana;
˳Ðò£ºfont-style | font-variant | font-weight | font-size | line-height | font-family
£¨×¢£º¼òдʱ£¬font-sizeºÍline-heightÖ»ÄÜͨ¹ýб¸Ü/×é³ÉÒ»¸öÖµ£¬²»ÄÜ·Ö¿ªÐ´¡££©
background
¼òд£º
background:#fff url(bg.gif) no-repeat fixed left top;
µÈЧÓÚ£º
background-color:#fff;background-image:url(bg.gif);background-repeat:no-repeat;background-attachment:fixed;background-position:left top;
˳Ðò£ºbackground-color | background-image | background-repeat | background-attachment | background-position
margin & padding
¼òд£º
margin:1px 0 2em -20px;
µÈЧÓÚ£º
margin-top:1px;margin-right:0;margin-bottom:2em;margin-left:-20px;
˳Ðò£ºmargin-top | margin-right | margin-bottom | margin-left
paddingµÄ¼òдºÍmarginÍêÈ«Ò»Ñù¡£
border
¼òд£º
border:1px solid #000;
µÈЧÓÚ£º
border-width:1px;border-style:solid;border-color:#000;
˳Ðò£ºborder-width | border-style | border-color
ÕâÈý¾äÒ²ÊǼòд£¬µÈÓÚÊÇ°ÑËıߵÄÑùʽºÏ¶øΪһÁË¡££¨¹ØÓÚËıߵÄÎÊÌ⣬ÏÂÎÄÓÐÏêϸ˵Ã÷£©
border-top / border-right / border-bottom / border-left
¼òд£º
border-top:1px solid #000;
µÈЧÓÚ£º
border-top-width:1px;border-top-style:solid;border-top-color:#000;
£¨ºÍborderÒ»Ñù£©
list-style
¼òд£º
list-style:square outside url(bullet.gif);
µÈЧÓÚ£º
list-style-type:square;list-style-position:outside;list-style-image:url(bullet.gif);
˳Ðò£ºlist-style-type | list-style-position | list-style-image
¹ØÓÚËıß
ÓкܶàÑùʽ¶¼Éæ¼°µ½ÁËËıߵÄÎÊÌ⣬ÕâÀïͳһ˵Ã÷¡£
Ëıߵļòдһ°ãÈçÏ£º
padding:1px 2px 3px 4px;
µÈЧÓÚ£º
padding-top:1px;padding-right:2px;padding-bottom:3px;padding-left:4px;
˳Ðò£ºtop | right | bottom | left
²»ÂÛÊDZ߿ò¿í¶È£¬»¹ÊDZ߿òÑÕÉ«¡¢±ß¾àµÈ£¬Ö»ÒªcssÑùʽÉæ¼°Ëıߣ¬Ë³Ðòͨͨ¶¼ÊÇ“ÉÏÓÒÏÂ×󔣨˳ʱÕë·½Ïò£©¡£
Èç¹ûËıߵÄֵʡÂÔÒ
Ïà¹ØÎĵµ£º
¿í¶È×ÔÊÊÓ¦µÄdiv+cssµÄBOX
²Î¿¼:
http://space.cnblogs.com/group/topic/3617/
http://www.dynamicdrive.com/style/layouts/item/css-left-and-right-frames-layout/ Ò»¡¢Ð§¹û£º ¶þ¡¢Ëزģº Èý¡¢´úÂ룺 <style type="text/css">
.box{}
.box .box_tit{position:rela ......
µ±div²ãΪfloatʱ£¬IE6ÖÐbox×óÓÒµÄmargin»á¼Ó±¶
±ÈÈ磺
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/htm ......
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ÏÂ,¿ÉÒÔʹÓÃ() ......
Ò»¡¢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
*+ht ......
1.idÑ¡ÔñÆ÷
idÑ¡ÔñÆ÷µÄÃüÃûÓ¦¼á³ÖÌåÏÖÎĵµµÄ½á¹¹ºÍλÖá£
Èç:#header¡¢#footer¡¢#left µÈ
2.classÑ¡ÔñÆ÷
classÑ¡ÔñÆ÷µÄÃüÃûÓ¦¸ÃÌåÏÖÃû³ÆµÄÑùʽÃèÊöÐÔ¡£
È磺.red¡¢.underline µÈ
3.¶ÔÓÚÄ£¿éµÄÍâΧ½á¹¹ÔªËØ×îºÃÓÃidÊôÐÔ£¬ÄÚ²¿ÔªËØ¿ÉÒÔ¶¨ÒåclassÊôÐÔ£¬
ÒòΪÍâΧµÄ½á¹¹Ò»°ãʽΨһµÄ¡£¶øÄÚ²¿µÄÔªËØ¿ÉÄÜ»á³öÏÖÖظ´¡£
ÁíÍ ......