Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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Ò»Ôò

Ò»¸öÖ»ÓÃCSS¾Í¿ÉÒÔÉèÖÃÍøÒ³ÖоÓÖвãµÄ·½·¨¡£
¡¡¡¡½ñÌìÖØг¢ÊÔµÄʱºò¾ÓÈ»²»ºÃÓÃÁË¡£
¡¡¡¡»¹ºÃÒÔÇ°µÄÒ³»¹ÓУ¬»¹ÄÜ´ò¿ª¡£
¡¡¡¡´úÂëÒ»ÃþÒ»Ñù¾ÍÊDz»ºÃÓá£
¡¡¡¡ÓÚÊǺõÒ»¶Î¶ÎµÄɾ³ý£¬Ï£ÍûÄÜÕÒµ½µãÏßË÷¡£
¡¡¡¡cssɾµÃֻʣÏÂÕâ¶ÎÉèÖôúÂ룬²»ºÃÓá£
¡¡¡¡javascriptÖÐÄѵÀ×öÊÖ½ÅÁË£¬½Ó×Åɾ£¬»¹ÊDz»ºÃÓá£
¡¡¡¡×îºóɾûÁËÖÕÓÚ·¢ÏÖÔ­À´ÊÇÍøҳͷÊDz»Ò»ÑùµÄ¡£
¡¡¡¡Ä¬ÈÏÓÃ.NET×Ô¶¯Éú³ÉµÄ¾Í²»ºÃÓÃ
<!DOCTYPE¡¡HTML¡¡PUBLIC¡¡"-//W3C//DTD¡¡HTML¡¡4.0¡¡Transitional//EN"¡¡>
¡¡¡¡¸Ä³ÉÈçϵĹý¶ÉÐÍÎĵµÀàÐ;ͿÉÒÔÓÃÁË¡£ËùÒÔÕâÒ»µãÒ»¶¨Òª×¢Òâ²ÅÐС£
<!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"¡¡xml:lang="en"¡¡lang="en">
¡¡¡¡ÏÂÃæÊǾÓÖеIJãµÄHTML´úÂë
¡¡¡¡<div¡¡id="pagebody"></div>
¡¡¡¡ÏÂÃæÊÇÉèÖþÓÖеÄCSS
#pagebody
{
¡¡¡¡¡¡¡¡width:¡¡940px;
¡¡¡¡¡¡¡¡background:¡¡#FFF;
¡¡¡¡¡¡¡¡margin:¡¡0¡¡auto;
} ......

8¿îÔÚÏßCSSÓÅ»¯¹¤¾ß/×éÖ¯ºÍѹËõCSS

CSSµÄÓÅ»¯Í¨³£°üÀ¨Á½·½Ãæ: ¸ñʽ»¯CSSºÍ¾«¼òCSS
¡£
 ¾«¼òCSSµÄ°ì·¨ÊǰѾßÓÐÏàͬÊôÐÔµÄÔªËغϲ¢ÔÚÒ»Æ𣬵«Õâ»á½µµÍ´úÂëµÄ¿É¶ÁÐÔ£¬Ê¹´úÂëµÄºóÆÚά»¤ºÜÂé·³£¬ÉÔ²»×¢Òâ¾Í³ö´í¡£ 
¸ñʽ»¯CSSÒ»°ã¾ÍÊǶàÐÐģʽ»òµ¥ÐÐģʽµÄÑ¡Ôñ£¬±ÈÈçÎÒ¸öÈ˾ÍÍêÈ«Êܲ»Á˶àÐÐģʽ
ÏÂÃæÊÇһЩÔÚÏßµÄCSSÓÅ»¯¹¤¾ß£¬ÄÜÈÃÄã·½±ãµÄ¶ÔCSSÎļþ½øÐи÷ÖÖÓÅ»¯´¦Àí¡£
1. Online CSS
Optimizer /ÔÚÏßCSSÓÅ»¯
 ¸ÃÔÚÏß¹¤¾ßÓÃÓÚ¾«¼òºÍѹËõÑùʽ±íµÄÎļþ´óС£¬ÓÅ»¯ºóµÄ´úÂ뽫ÍêÈ«ÊÇ»ìÂҵģ¬Ö§³ÖÊäÈëURL£¬Ìá½»ÎļþºÍÖ±½ÓÊäÈë½øÐÐѹËõ¡£
2. CSS
Compressor/CSSѹËõ
 ×÷ÓÃͬÉÏ£¬µ«Õâ¸ö¹¤¾ßÓµÓзdz£ÏêϸµÄѹËõÑ¡ÏËü°üº¬»ù±¾Ä£Ê½ºÍ¸ß¼¶Ä£Ê½¡£ 
ÔÚ»ù±¾Ä£Ê½ÏÂ, Äã¿ÉÒÔÑ¡ÔñѹËõģʽ:
Çá¶È£¬±ê×¼ºÍ¸ß¶È¡£×î¸ßģʽѹËõºóµÄÎļþ×îС£¬µ«Í¬Ê±¿É¶ÁÐÔÒ²¾Í×îµÍ£¬ÉõÖÁѹËõºó¾Í³öÎÊÌâÒ²¿ÉÄÜ£¬ÒÔ´ËÀàÍÆ¡£»¹¿ÉÒÔÑ¡ÔñCSS×¢ÊÍ´úÂëµÄ´¦Àí:
²»´¦Àí×¢ÊÍ£¬Çå³ýËùÓÐ×¢ÊÍ»òÏÞ¶¨×¢ÊÍ×Ö·ûÊý¡£ 
Ôڸ߼¶Ä£Ê½Ï£¬»¹¿ÉÒÔ¶Ô¿Õ°×£¬Tab£¬ÐÂÐеȵȽøÐÐÑ¡Ôñ´¦Àí¡£
3. CleanCSS /
CSS¸ñʽ»¯ºÍÓÅ»¯¹¤¾ß
 »ùÓÚ CssTidy

µÄÒ»¿îÔÚÏßCSSÓÅ»¯¹¤¾ß£¬¼È¿ÉÒÔ¸ñʽ»¯CSS´úÂ룬Ҳ¿ÉÒÔÓÅ»¯CSS¼õÉÙCSSÎļþ´óС£ ......

Ò³ÃæÔªËؾÓÖÐ css»ñÈ¡Ò³ÃæÖÐÐÄλÖÃ

css»ñÈ¡Ò³ÃæÖÐÐÄλÖÃ
.fixed
{
FONT-SIZE: 30pt;
color : #1A6841;
left:expression(eval(document.body.clientWidth)/2-150);
top:expression(eval(document.body.clientHeight)/2-25);
width:300px;
height:50px;
border:green 1px solid;
background:#99CCFF;
+position:absolute;
+left:expression(eval(document.body.scrollLeft)+eval(document.body.clientWidth)/2-150);
+top:expression(eval(document.body.scrollTop)+eval(document.body.clientHeight)/2-25);
}
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.clientWidth
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.clientHeight
ÍøÒ³¿É¼ûÇøÓò¿í£ºdocument.body.offsetWidth (°üÀ¨±ßÏߵĿí)
ÍøÒ³¿É¼ûÇøÓò¸ß£ºdocument.body.offsetHeight (°üÀ¨±ßÏߵĿí)
ÍøÒ³ÕýÎÄÈ«ÎÄ¿í£ºdocument.body.scrollWidth
ÍøÒ³ÕýÎÄÈ«Îĸߣºdocument.body.scrollHeight
ÍøÒ³±»¾íÈ¥µÄ¸ß£ºdocument.body.scrollTop
ÍøÒ³±»¾íÈ¥µÄ×ó£ºdocument.body.scrollLeft
ÍøÒ³ÕýÎIJ¿·ÖÉÏ£ºwindow.screenTop
ÍøÒ³ÕýÎIJ¿·Ö×ó£ºwindow.screenLeft
ÆÁÄ»·Ö±æÂʵĸߣºwindow.screen.height
ÆÁÄ»·Ö±æÂÊµÄ¿í£ºwindow.screen.width
ÆÁÄ»¿ÉÓà ......

CSS ÃüÃû¹æ·¶

CSS ÃüÃû¹æ·¶
XHTML-CSSд×÷½¨Òé
ËùÓеÄxhtml´úÂëСд
ÊôÐÔµÄÖµÒ»¶¨ÒªÓÃË«ÒýºÅ("")À¨ÆðÀ´£¬ÇÒÒ»¶¨ÒªÓÐÖµ
ÿ¸ö±êÇ©¶¼ÒªÓпªÊ¼ºÍ½áÊø£¬ÇÒÒªÓÐÕýÈ·µÄ²ã´Î
¿ÕÔªËØÒªÓнáÊøµÄtag»òÓÚ¿ªÊ¼µÄtagºó¼ÓÉÏ"/"
±íÏÖÓë½á¹¹ÍêÈ«·ÖÀ룬´úÂëÖв»Éæ¼°ÈκεıíÏÖÔªËØ£¬Èçstyle¡¢font¡¢bgColor¡¢borderµÈ
<h1>µ½<h5>µÄ¶¨Ò壬Ӧ×ñÑ­´Ó´óµ½Ð¡µÄÔ­Ôò£¬ÌåÏÖÎĵµµÄ½á¹¹£¬²¢ÓÐÀûÓÚËÑË÷ÒýÇæµÄ²éѯ¡£
¸øÿһ¸ö±í¸ñºÍ±íµ¥¼ÓÉÏÒ»¸öΨһµÄ¡¢½á¹¹±ê¼Çid
¸øÖØÒªµÄÇø¿é¼ÓÉÏ×¢ÊÍ,È磺
¸øͼƬ¼ÓÉÏalt±êÇ©
ËùÓеıêÇ©±ØÐë½øÐкÏÀíµÄǶÌ×
¸ùÔªËØÇ°±ØÐëÓÐÔªËØ£¬Ðû¸æʹÓÃÄÇÒ»ÖÖDTD
¸ùÔªËرØÐëÓÐxmlnsÊôÐÔÀ´Ö¸¶¨Ê¹ÓÃhttp://www.w3.org/1999/xhtmlµÄnamespace
CSSÑùʽ±í¹æ·¶£º
idºÍclassÃüÃû²ÉÓøðæ¿éµÄÓ¢Îĵ¥´Ê»ò×éºÏÃüÃû£¬²¢µÚÒ»¸öµ¥´ÊСд£¬µÚ¶þ¸öµ¥´ÊÊ׸ö×Öĸ´óд£¬Èç:newRelease£¨×îвúÆ·
/new+Release)
CSSÑùʽ±í¸÷Çø¿éÓÃ×¢ÊÍ˵Ã÷
¾¡Á¿Ê¹ÓÃÓ¢ÎÄÃüÃûÔ­Ôò
¾¡Á¿²»¼ÓÖиܺÍÏ»®Ïß
¾¡Á¿²»Ëõд£¬³ý·ÇÒ»¿´¾ÍÃ÷°×µÄµ¥´Ê
CSSÃüÃû¹æ·¶£º
DIV
CSSÃû³Æ
˵Ã÷

ÍøÕ¾¹«ÓÃÏà¹Ø

Container div
#container
ÈÝÆ÷
Layout
#layout
²¼¾Ö
Header o ......

CSSÖеÄmarginÓëpaddingÓÐʲôÇø±ðÄØ

margin Íâ±ß¾à
border ±ß¿ò
padding Äڱ߾à
Ò²¾ÍÊÇ˵ ÉèÖÃmargin ÄÇôËûËùÕ¼¾ÝµÄ¿Õ°×µØ·½»áÊÇÔڱ߿òÍâÃæ
ÉèÖÃpadding ËûËùÕ¼¾ÝµÄ¿Õ°×µØ·½ÊÇÔڱ߿òÀïÃæ
¶øÇÒÔÚIE6 һϵİ汾ÖÐ ´æÔÚÕâpadding ¼ÆËã´íÎóµÄBUG
CSS µÄ¿í¶ÈÊôÐÔ±¾À´ÊDz»°üº¬paddingµÄ µ«ÊÇ ÔÚieÏÂÃæÓеÄʱºò¿í¶ÈÊÇ°üº¬padding ËùÒÔ ½¨ÒéÔÚ²»ÊìϤCSS ÔÚ¶¨Î»µÄʱºò ¶¼ÓÃmarginÊôÐÔ ......

cssÖÐpaddingºÍmarginµÄÏêϸÇø±ð

±¾ÎĽ«½²ÊöHTMLºÍCSSµÄ¹Ø¼ü—ºÐ×ÓÄ£ÐÍ(Box model). Àí½âBox modelµÄ¹Ø¼ü±ãÊÇmarginºÍpaddingÊôÐÔ, ¶øÕýÈ·Àí½âÕâÁ½¸öÊôÐÔÒ²ÊÇѧϰÓÃcss²¼¾ÖµÄ¹Ø¼ü.
×¢: Ϊʲô²»·­ÒëmarginºÍpadding? Ô­ÒòÒ», ÔÚººÓïÖв¢Ã»ÓÐÓëÖ®Ïà¶ÔÓ¦µÄ´ÊÓï; Ô­Òò¶þ: ¼´Ê¹ÓÐÕâÑùµÄ´ÊÓï, ÓÉÓÚÔÚ±àдcss´úÂëʱ, ±ØÐëʹÓÃmarginºÍpadding, Èç¹ûÎÒÃÇ×ÜÓúºÓï´ÊÓï´úÌæÆäÀ´½âÊ͵Ļ°, µ½ÁËʵ¼ÊÓ¦ÓÃʱÈÝÒ×»ìÏýmarginºÍpaddingµÄ¸ÅÄî.
Èç¹ûÓÐÒ»µãHtml»ù´¡µÄ»°, ¾ÍÓ¦¸ÃÁ˽âһЩ»ù±¾ÔªËØ(Element), Èçp, h1~h6, br, div, li, ul, imgµÈ. Èç¹û½«ÕâЩԪËØϸ·Ö, ÓÖ¿ÉÒÔ·Ö±ð¹éΪ¶¥¼¶(top-level)ÔªËØ,¿é¼¶(block-level)ÔªËغÍÄÚÁª(inline)ÔªËØ.
1. Block-level element: Ö¸Äܹ»¶ÀÁ¢´æÔÚ, Ò»°ãµÄ¿é¼¶ÔªËØÖ®¼äÒÔ»»ÐÐ(ÈçÒ»¸ö¶ÎÂä½áÊøºóÁíÆðÒ»ÐÐ)·Ö¸ô. ³£ÓõĿ鼶ԪËØ°üÀ¨: p, h1~h6, div, ulµÈ;
2. Inline element: Ö¸ÒÀ¸½ÆäËû¿é¼¶ÔªËØ´æÔÚ, ½ô½ÓÓÚ±»ÁªÔªËØÖ®¼äÏÔʾ, ¶ø²»»»ÐÐ. ³£ÓõÄÄÚÁªÔªËØ°üÀ¨: img, span, li, brµÈ;
3. Top-level element: °üÀ¨html, body, frameset, ±íÏÖÈçBlock-level element, ÊôÓڸ߼¶¿é¼¶ÔªËØ.
¿é¼¶ÔªËØÊǹ¹³ÉÒ»¸öhtmlµÄÖ÷ÒªºÍ¹Ø¼üÔªËØ, ¶øÈÎÒâÒ»¸ö¿é¼¶ÔªËؾù¿ÉÒÔÓÃBox modelÀ´½âÊÍ˵Ã÷.
......
×ܼǼÊý:772; ×ÜÒ³Êý:129; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [9] [10] [11] [12] 13 [14] [15] [16] [17] [18]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ