DIV css Ïà¶Ô¸¸ÈÝÆ÷ ˮƽ¡¢´¹Ö± ¾ÓÖÐ
ÖÕÓÚ°ÑËüд³öÀ´ÁË¡£¹þ¹þ
<div style="width:100%;height:100%;position:relative;overflow:hidden;"
><br style="line-height:0;"
/><div style="position:relative;top:50%;left:50%;"><br style="line-height:0;"
/><div style="position:relative;
background-color:Yellow;
height:200px;width:200px;
margin-top:-100px;margin-left:-100px;overflow:auto;"
><br style="line-height:0;"
/><div>
Ãû³Æ£º<asp:TextBox runat="server" ID="name"></asp:TextBox>
</div>
<br />
<div>
ÏÔʾÃû£º<asp:TextBox runat="server" ID="TextBox1"></asp:TextBox>
</div>
</div>
</div>
</div>
ǰ3²ãDIVÊDZØÐëµÄ¡£
Èç¹ûÊÇIE¿ÉÒÔÈ¥µôµÚÒ»²ãDIV.
ÏÂÃæ4¸öÊý¾Ý£º
height:200px;width:200px;
margin-top:-100px;margin-left:-100px;"
±ØÐëÈ˹¤¼ÆËã¡£
--ÒÔºóÓÐʱ¼äÔÙдÍêÈ«×Ô¶¯µÄ²¼¾ÖµÄcss
Ïà¹ØÎĵµ£º
ÔÚʹÓÓfloat”ʱ£¬ÒòΪ“float”ÊÇjavascriptµÄÒ»¸ö±£Áô×Ö£¬ËùÒԾͲ»ÄÜʹÓÃstyle.float£¬¶ø¸Ä³ÉÁËstyle.cssFloat(IEʹÓõÄÊÇstyle.styleFloat)£»
if (window.navigator.userAgent.indexOf("MSIE")>=1)
{
this.listDiv01.style.styleFloat = "left";
this.listDiv02.style.styleFl ......
ÔÚtable ÖпØÖƵ¥Ôª¸ñÖ®¼äµÄ¼ä¾àÒªÓõ½cellspacing¡¢cellpadding£¬Ä¬ÈÏÇé¿öcellspacing¡¢cellpadding¾ù²»Îª0£¬µ«¾³£µÄ×´¿öΪÁ˲»ÈÃtableµ¥Ôª¸ñÖ®¼äµÄ¼ä¾àÓ°Ïìµ½ÃÀ¹Û£¬ÎÒÃǾ³£»á°Ñcellspacing¡¢cellpaddingÉèÖÃΪ0£¬Òò´Ë¾³£¿´µ½“< table cellspacing=0 cellpadding=0>”ÕâÑùµÄ´úÂë¡£ÕâÑù×öÎÞÐÎÖÐÔö¼ÓÁË´ ......
CSS£¬²ãµþÑùʽ±íµÄ×÷ÓÃÊÇʲô£¿ÎÒÃÇÏÈͨ¹ýÒ»¸öÀý×ÓÀ´Ìå»áһϣº
¿´´úÂ룺
index.html
<!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=" ......
cssĬÈϵIJ¼¾ÖÊǽ«ÔªËØÒ»¸öÒ»¸öµØÍùÏÂÅÅÁÐÏÂÀ´£¬Èç¹û²»²ÉÈ¡¸¡¶¯£¬½«µ¼ÖÂÒ³Ãæ·Ç³£³¤¡£
ÏÂÃæÎÒÃÇͨ¹ý×öÒ»¸ö³£¼ûµÄÍøÕ¾²¼¾Ö£¬À´ËµÃ÷¸¡¶¯ÊÇÔõôһ»ØÊ¡£
Ï£ÍûµÄЧ¹ûÊÇ:
²½ÖèÒ»¡¢ÏȰѴúÂëдһÏ£¬
Àý£º
htmlÄÚÈÝ£º
<body >
<div id="head">
head
</div>
<div id="content">
c ......
Öð½¥Ï²»¶ÉÏpadding ËäÈ»Ëü²¢²»ÍêÃÀ£¬ÈκÎÊÂÎï¶¼ÓÐÁ½ÃæÐÔ£¬ÎÞËùν¶Ô´í£¬¹Ø¼üÊÇÒªÓöԵط½£¡
padding ºÍ marginÏà±È½Ï£¬padding ¿ÉÒÔ½«div µÈ³ÅÆðÀ´Õ¼ÓÃʵ¼Ê¿Õ¼ä£¬¶ømarginÔò±È½ÏСÐÄ¡£
µ«ÊǾÍÊÇpaddingÕâµãȱ°ïÎÒ½â¾öÁËÒ»¸öinput ºÍ submitµÄ¶ÔÆëÎÊÌâ¡£ ......