div+css(Ò»)
ÍøÒ³Éè¼ÆDIV+CSSÔªËؽâÎö£¬<head>²¿·ÖÇ°£º
£¨Ò»£© DOCTYPE ºÍDTD
ÓÃDWн¨Íøҳʱ£¬×Ü»áÉú³ÉÒ»¾ä
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Õâ¾äÊÇDOCTYPEÉùÃ÷£¬DOCTYPEÊÇdocument type(ÎĵµÀàÐÍ)µÄ¼òд£¬ÓÃÀ´ËµÃ÷ÄãÓõÄXHTML»òÕßHTMLÊÇʲô°æ±¾¡£ÆäÖеÄDTD(ÀýÈçÉÏÀýÖеÄxhtml1-transitional.dtd)½ÐÎĵµÀàÐͶ¨Ò壬ÀïÃæ°üº¬ÁËÎĵµµÄ¹æÔò£¬ä¯ÀÀÆ÷¾Í¸ù¾ÝÄ㶨ÒåµÄDTDÀ´½âÊÍÄãÒ³ÃæµÄ±êʶ£¬²¢Õ¹ÏÖ³öÀ´¡£
Òª½¨Á¢·ûºÏ±ê×¼µÄÍøÒ³£¬DOCTYPEÉùÃ÷ÊDZز»¿ÉÉٵĹؼü×é³É²¿·Ö£»³ý·ÇÄãµÄXHTMLÈ·¶¨ÁËÒ»¸öÕýÈ·µÄDOCTYPE£¬·ñÔòÄãµÄ±êʶºÍCSS¶¼²»»áÉúЧ¡£ XHTML 1.0 ÌṩÁËÈýÖÖDTDÉùÃ÷¿É¹©Ñ¡Ôñ£º
¹ý¶ÉµÄ(Transitional):ÒªÇó·Ç³£¿íËɵÄDTD£¬ËüÔÊÐíÄã¼ÌÐøʹÓÃHTML4.01µÄ±êʶ(µ«ÊÇÒª·ûºÏxhtmlµÄд·¨)¡£ÍêÕû´úÂëÈçÏ£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
ÑϸñµÄ(Strict):ÒªÇóÑϸñµÄDTD£¬Äã²»ÄÜʹÓÃÈκαíÏÖ²ãµÄ±êʶºÍÊôÐÔ£¬ÀýÈç<br>¡£ÍêÕû´úÂëÈçÏ£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
¿ò¼ÜµÄ(Frameset):רÃÅÕë¶Ô¿ò¼ÜÒ³ÃæÉè¼ÆʹÓõÄDTD£¬Èç¹ûÄãµÄÒ³ÃæÖаüº¬Óпò¼Ü£¬ÐèÒª²ÉÓÃÕâÖÖDTD¡£ÍêÕû´úÂëÈçÏ£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
£¨¶þ£© XHTML namespace
ÔÚDOCTYPEÉùÃ÷Ö®ºóÊÇ<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">£¬xmlnsÊÇXML namespaceµÄËõд£¬Ãû×Ö¿Õ¼äµÄÒâ˼£¬Í¨Ë׵ĽâÊÍÊÇ£ºÃû×Ö¿Õ¼ä¾ÍÊǸøÎĵµ×öÒ»¸ö±ê¼Ç£¬¸æËß±ðÈË£¬Õâ¸öÎĵµÊÇÊôÓÚ˵ġ£Ö»²»¹ýÕâ¸ö"Ë"ÓÃÁËÒ»¸öÍøÖ·À´´úÌæ¡£ XHTMLÊÇHTMLÏòXML¹ý¶ÉµÄ±êʶÓïÑÔ£¬ËüÐèÒª·ûºÏXMLÎĵµ¹æÔò£¬Òò´ËÒ²ÐèÒª¶¨ÒåÃû×ֿռ䡣ÓÖÒòΪXHTML1.0²»ÄÜ×Ô¶¨Òå±êʶ£¬ËùÒÔËüµÄÃû×ֿռ䶼Ïàͬ£¬¾ÍÊÇhttp://www.w3.org/1999/xhtml
£¨Èý£© ¶¨ÒåÓïÑÔ±àÂë
<meta http-equiv="Content-Type" content="text/ht
Ïà¹ØÎĵµ£º
ǰ̨div
Html´úÂë
<div id="DIV1" runat="server" >
</div>
ºǫ́:
C#´úÂë
this.DIV1.Style.Value = "display:none";
»òÕß:
C#´úÂë
DIV1.Attributes.CssStyle.Value = "display:none";
......
×ÖÐÍ
ÎÄ×Ö顏É«
color: #000;
ÎÄ×Ö´óС
font-size: 8pt;
ÎÄ×Ö×Ö體
font-family: “arial”, dotum;
ÎÄ×Öб體
font-style: italic;
С×Ö體
font-variant: small-caps;
×Ö間¾à離
letter-spacing: 1pt;
Ðиß
line-height: 15px; (Òà¿É為°Ù·Ö±È)
ÎÄ×Ö´ ......
Óï·¨£º
border-width : medium | thin | thick | length
²ÎÊý£º
medium : ¡¡Ä¬ÈÏ¿í¶È
thin : ¡¡Ð¡ÓÚĬÈÏ¿í¶È
thick : ¡¡´óÓÚĬÈÏ¿í¶È
length : ¡¡Óɸ¡µãÊý×ֺ͵¥Î»±êʶ·û×é³ÉµÄ³¤¶ÈÖµ¡£²»¿ÉΪ¸ºÖµ¡£Çë²ÎÔij¤¶Èµ¥Î»
˵Ã÷£º
Èç¹ûÌṩȫ²¿Ëĸö²ÎÊýÖµ£¬½«°´ÉÏ£Óңϣ×óµÄ˳ ......
¼ä϶ÊôÐÔÊÇÓÃÀ´ÉèÖÃÔªËØÄÚÈݵ½ÔªËر߽çµÄ¾àÀë¡£°üÀ¨£º
1£©×ó¼ä϶ÊôÐÔ£¨padding-left£©
Õâ¸öÊôÐÔÓÃÀ´É趨×ó¼ä϶µÄ¿í¶È¡£ÀýÈ磺
.d1{padding-left:1cm}
2£©ÓÒ¼ä϶ÊôÐÔ£¨padding-right£©
Õâ¸öÊôÐÔÓÃÀ´É趨ÓÒ¼ä϶µÄ¿í¶È¡£ÀýÈ磺
.d1 {padding-right:1cm}
3£©Éϼä϶ÊôÐÔ£¨padding-top£©
Õâ¸öÊôÐÔÓÃÀ´É趨Éϼä϶µÄ¿í¶È¡£À ......
<div style="padding-top:5px;width:200px;height:15px;background-color:#ffeeee"> test </div>
ÒÔÉÏ´úÂëÔÚIEÖкÍfirefox»áÓв»Í¬µÄЧ¹û.×îÖ÷ÒªÔÒòÊÇfirefox½âÊÍpadding-topÓëIEµÄЧ¹û²»Í¬
fixfox¶ÔDIV×ܸ߶ÈÊÇpadding-top+heightµÄ,¶øIEÖÐ,padding-topÊÇ°üº¬ÔÚheightÖеÄ,
Òª½â¾öÕâÒ»¸öì¶Ü,¿ÉÒÔÀûÓÃ!imp ......