Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : css

´¿CSSÖÆ×÷Èý¼¶²Ëµ¥,¿ÉÀ©Õ¹ÎÞÏÞ


×¢Ã÷£ºÈç¹ûÒªÏëÒªÔÚIE6ÎÞÏÞ¼¶µÄ»°ÐèҪд¶àһЩJS£¬ÆäËûÓÎÀÀÆ÷¶¼¿ÉÒÔʹÓÃͬ¶Îjs
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>JavaScriptÏÂÀ­²Ëµ¥</title>
    <style type="text/css">
        body,ul,li{margin:0; padding:0; font-size:12px; list-style:none;}
        #navigation {
            margin:20px; height:auto;
        }
        #navigation li {
            position:relative;width:130px; height:40px;border-bottom:1px solid #999999;
&nbs ......

CSSÏÂÀ­²Ëµ¥

ÕâÊÇÒ»¸ö±ê×¼µÄCSSÏÂÀ­²Ëµ¥ÖÆ×÷½Ì³Ì£¬ÓÐÕë¶ÔÄ¿Ç°Á÷ÐеÄIE6/IE7/IE8²»Í¬°æ±¾µÄCSS´úÂ룬Òò´Ë¿ÉÒÔÔÚIEÖ®¼äÍêÈ«¼æÈÝ£¬²»¹ýÆäËüµÄä¯ÀÀÆ÷Ïñ»ðºü/GGä¯ÀÀÆ÷Ö®ÀàµÄûÓвâÊÔ£¬Èç¹û¼æÈÝIE8µÄ»°£¬ÄÇô¼æÈÝ»ðºüÓ¦¸ÃÎÊÌâ²»´ó°É¡£²Ëµ¥Ê¹ÓÃÀ¶É«»ùµ÷£¬»¬Ïò¶þ¼¶²Ëµ¥¸ü»»±³¾°£¬²Ù×÷µÄ¸Ð¾õºÜÊæ·þ¡£
<!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/html; charset=UTF-8">
<title>´¿cssÏÂÀ­²Ëµ¥</title>
<!--[if IE 7]><!-->
<mce:style><!--
body {
font-family:verdana, sans-serif;
font-size:small;
}
#navigation , #navigation li ul{
padding:0;
margin:0;
list-style-type: none;
}
#navigation li {
float:left;
text-align:center;
position:relative;
}
#navigation li h3 {
margin:0;
}
#navigation li a:link, #navigation li a:visited {
display:block;
text-decoration:none;
color:#00 ......

CSS Îı¾¶ÔÆë

text-align  ˮƽ¶ÔÆë  right left center
vertical-align ´¹Ö±¶ÔÆë top middle bottom
ÊôÐÔ£º
AbsBottom ͼÏñµÄϱßÔµÓëͬһÐÐÖÐ×î´óÔªËصÄϱßÔµ¶ÔÆë¡£
AbsMiddle ͼÏñµÄÖмäÓëͬһÐÐÖÐ×î´óÔªËصÄÖмä¶ÔÆë¡£
Baseline ͼÏñµÄϱßÔµÓëµÚÒ»ÐÐÎı¾µÄϱßÔµ¶ÔÆë¡£
Bottom ͼÏñµÄϱßÔµÓëµÚÒ»ÐÐÎı¾µÄϱßÔµ¶ÔÆë¡£
Left ͼÏñÑØÍøÒ³µÄ×ó±ßÔµ¶ÔÆ룬ÎÄ×ÖÔÚͼÏñÓұ߻»ÐС£
Middle ͼÏñµÄÖмäÓëµÚÒ»ÐÐÎı¾µÄϱßÔµ¶ÔÆë¡£
NotSet δÉ趨¶ÔÆ뷽ʽ¡£
Right ͼÏñÑØÍøÒ³µÄÓÒ±ßÔµ¶ÔÆ룬ÎÄ×ÖÔÚͼÏñ×ó±ß»»ÐС£
TextTop ͼÏñµÄÉϱßÔµÓëͬһÐÐÉÏ×î¸ßÎı¾µÄÉϱßÔµ¶ÔÆë¡£
Top ͼÏñµÄÉϱßÔµÓëͬһÐÐÉÏ×î¸ßÔªËصÄÉϱßÔµ¶ÔÆë¡£ ......

15¸öÄã±ØÐëÖªµÀµÄCSS³£Ê¶

1¡¢²»ÒªÊ¹ÓùýСµÄͼƬ×ö±³¾°Æ½ÆÌ¡£Õâ¾ÍÊÇΪºÎºÜ¶àÈ˶¼²»Óà 1px µÄÔ­Òò£¬Õâ²ÅÖªÏþ¡£¿í¸ß 1px µÄͼƬƽÆ̳öÒ»¸ö¿í¸ß 200px µÄÇøÓò£¬ÐèÒª 200*200=40, 000 ´Î£¬Õ¼ÓÃ×ÊÔ´¡£
2¡¢Îޱ߿ò¡£ÍƼöµÄд·¨ÊÇ border:none;£¬¹þ¹þ£¬ÎÒÒ»Ö±ÔÚÓÃÕâ¸ö¡£border:0; Ö»ÊǶ¨Òå±ß¿ò¿í¶ÈΪÁ㣬µ«±ß¿òÑùʽ¡¢ÑÕÉ«»¹Êǻᱻä¯ÀÀÆ÷½âÎö£¬Õ¼ÓÃ×ÊÔ´¡£
3¡¢É÷Óà * ͨÅä·û¡£ËùνͨÅä·û£¬¾ÍÊǽ« CSS ÖеÄËùÓбêÇ©¾ù³õʼ»¯£¬²»¹ÜÓõIJ»Óõģ¬¹ýʱµÄÏȽøµÄ£¬Ò»ÊÓͬÈÊ£¬ÕâÑù£¬´ó´óµÄÕ¼ÓÃ×ÊÔ´¡£ÒªÓÐÑ¡ÔñµÄ³õʼ»¯±êÇ©¡£
4¡¢CSS µÄÊ®Áù½øÖÆÑÕÉ«´úÂëËõд¡£Ï°¹ßÁËËõд¼°Ð¡Ð´£¬Õâ²ÅÖªµÀ£¬Ô­À´²»ÊÇÍƼöµÄд·¨£¬ÎªµÄÊǼõÉÙ½âÎöËùÕ¼ÓõÄ×ÊÔ´¡£µ«Í¬Ê±»áÔö¼ÓÎļþÌå»ý¡£ÊëÓÅÊëÁÓ£¬Óдý×Ðϸ¿¼Ö¤¡£
5¡¢Ñùʽ·ÅÍ·ÉÏ£¬½Å±¾·Å½ÅÏ¡£²»ÄÚǶ£¬Ö»ÍâÁ´¡£
6¡¢¼á¾ö²»Óà CSS ±í´ïʽ¡£
7¡¢Ê¹Óà ÒýÓÃÑùʽ±í£¬¶ø²»ÊÇͨ¹ý @import µ¼Èë¡£
8¡¢Ò»°ãÀ´Ëµ£¬PNG ±È GIF ҪС£¬Ð¡µÃ¶à¡£ÔÙÕߣ¬GIF ÖÐÓжàÉÙÑÕÉ«ÊDZ»À˷ѵģ¬ºÜÖµµÃÓÅ»¯¡£
9¡¢Ç§Íò²»ÒªÔÚ HTML ÖÐËõ·ÅͼƬ£¬Ò»Õß²»ºÃ¿´£¬¶þÕßÕ¼×ÊÔ´¡£
10¡¢ÕýÎÄ×ÖÌå×îºÃÓÃżÊý£¬12px¡¢14px¡¢16px£¬Ð§¹û·Ç³£ºÃ¡£ÌØÀý£¬15px¡£
11¡¢block¡¢ul¡¢ol µÈÉÏÏÂÁô³öÖÁÉÙÒ»±¶Ðо࣬×ó²àÖÁÉÙÁ½±¶Ðо࣬ÓÒ²àËæÒâ ......

ÏêÊöCSSÖе¥Î»pxºÍemµÄÇø±ð

¹úÄÚµÄÉè¼Æʦ´ó¶¼Ï²»¶ÓÃpx£¬¶ø¹úÍâµÄÍøÕ¾´ó¶¼Ï²»¶ÓÃem£¬ÄÇôÁ½ÕßÓÐʲôÇø±ð£¬ÓÖ¸÷×ÔÓÐʲôÓÅÁÓÄØ£¿
1¡¢IEÎÞ·¨µ÷ÕûÄÇЩʹÓÃpx×÷Ϊµ¥Î»µÄ×ÖÌå´óС£»
2¡¢¹úÍâµÄ´ó²¿·ÖÍøÕ¾Äܹ»µ÷ÕûµÄÔ­ÒòÔÚÓÚÆäʹÓÃÁËem×÷Ϊ×ÖÌ嵥λ£»
3¡¢FirefoxÄܹ»µ÷ÕûpxºÍem£¬µ«ÊÇ96%ÒÔÉϵÄÖйúÍøÃñʹÓÃIEä¯ÀÀÆ÷£¨»òÄںˣ©¡£
pxÏñËØ£¨Pixel£©£¬Ïà¶Ô³¤¶Èµ¥Î»¡£ÏñËØpxÊÇÏà¶ÔÓÚÏÔʾÆ÷ÆÁÄ»·Ö±æÂʶøÑԵġ££¨Òý×ÔCSS2.0Êֲᣩ
emÊÇÏà¶Ô³¤¶Èµ¥Î»¡£Ïà¶ÔÓÚµ±Ç°¶ÔÏóÄÚÎı¾µÄ×ÖÌå³ß´ç¡£È統ǰ¶ÔÐÐÄÚÎı¾µÄ×ÖÌå³ß´çδ±»ÈËΪÉèÖã¬ÔòÏà¶ÔÓÚä¯ÀÀÆ÷µÄĬÈÏ×ÖÌå³ß´ç¡££¨Òý×ÔCSS2.0Êֲᣩ
ÈÎÒâä¯ÀÀÆ÷µÄĬÈÏ×ÖÌå¸ß¶¼ÊÇ16px¡£ËùÓÐδ¾­µ÷ÕûµÄä¯ÀÀÆ÷¶¼·ûºÏ£º1em=16px¡£ÄÇô12px=0.75em£¬10px=0.625em¡£ÎªÁ˼ò»¯font-sizeµÄ»»Ë㣬ÐèÒªÔÚCSSÖеÄbodyÑ¡ÔñÆ÷ÖÐÉùÃ÷ Font-size=62.5%£¬Õâ¾ÍʹemÖµ±äΪ 16px*62.5%=10px£¬ÕâÑù12px=1.2em£¬10px=1em£¬Ò²¾ÍÊÇ˵ֻÐèÒª½«ÄãµÄÔ­À´µÄpxÊýÖµ³ýÒÔ10£¬È»ºó»»ÉÏem×÷Ϊµ¥Î»¾ÍÐÐÁË¡£
emÓÐÈçÏÂÌص㣺
1¡¢emµÄÖµ²¢²»Êǹ̶¨µÄ£»
2¡¢em»á¼Ì³Ð¸¸¼¶ÔªËصÄ×ÖÌå´óС¡£
ËùÒÔÎÒÃÇÔÚдCSSµÄʱºò£¬ÐèҪעÒâÁ½µã£º
1¡¢bodyÑ¡ÔñÆ÷ÖÐÉùÃ÷Font-size=62.5%£»
2¡¢½«ÄãµÄÔ­À´µÄpxÊýÖµ³ýÒÔ10£¬È»ºó»»ÉÏem×÷Ϊµ¥Î ......

CSSµÄ¼¸ÖÖÑ¡Ôñ·û

      Ó¦ÓÃÑùʽµÄ·½·¨ÓÐÈýÖÖ£ºÍⲿ(external)¡¢ÄÚ²¿(internal)ºÍÄÚÁª(inline)¡£ÆäÖÐÇ°Á½ÕߵĻù±¾¸ñʽΪ£º
            selector { property £º value£» }
      CSSÖпÉÒÔʹÓò»Í¬µÄselector(Ñ¡Ôñ·û)À´Ó¦ÓÃÑùʽ£¬ÈçÏ£º
            1.
ÀàÐÍÑ¡Ôñ·û
                        p{
                          color : blue ;
                        }
               ½«ÑùʽӦÓÃÓÚËùÓÐ<p>ÔªËØ¡£
        &n ......
×ܼǼÊý:772; ×ÜÒ³Êý:129; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [7] [8] [9] [10] 11 [12] [13] [14] [15] [16]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ