CSSÐÞÊεıí¸ñ
ÏÂÃæÕâ¸öCSSÑùʽµÄ±í¸ñ£¬¸öÈ˸оõÑÕÉ«Æðµ½Á˺ܴóµÄ×÷Óá£Èç¹û²»ÊÇÁ½ÖÖÑÕÉ«µÄ¶Ô±ÈЧ¹ûºÃ£¬¿ÉÄÜÒ²¾ÍÊÇÒ»°ãµÄ±í¸ñ£º
ÏÈÀ´¿´HTML£º
<table width="590" cellspacing="1">
<caption>
text
</caption>
<thead>
<tr>
<th class="line1" scope="col">text</th>
<th scope="col">text</th>
<th scope="col">text</th>
<th class="line4" scope="col">More</th>
</tr>
</thead>
<tbody>
<tr>
<th height="78">text text text text</th>
<td>text text text text</td>
<td>text text text</td>
<td class="line4"> </td>
</tr>
</tbody>
<tfoot>
<tr>
<th></th>
<td></td>
<td></td>
<td></td>
</tr>
</tfoot>
</table>
ÉÏÃæµÄ±í¸ñûÓÐʲôҪ½âÊ͵쬽¨Òé´ó¼ÒÓÃthead,tbody,tfootÕâЩ¾ßÓÐÓïÒåµÄ±êÇ©¡£
body{
background-color:#D5DFE9;
}
table{
border-spacing:1px;
border:1px solid #A2C0DA;
}
td, th{
padding:2px 5px;
border-collapse:collapse;
text-align:left;
font-weight:normal;
}
thead tr th{
background:#B0D1FC;
border:1px solid white;
}
thead tr th.line1{
background:#D3E5FD;
}
thead tr th.line4{
background:#C6C6C6;
}
tbody tr td{
height:50px;
background:#CBE2FB;
border:1px solid white;
vertical-align:top;
}
tbody tr td.line4{
background:#D5D6D8;
}
tbody tr th{
height:50px;
background: #DFEDFF;
border:1px solid white;
vertical-align:top;
}
caption,tfoot{
display:none;
}
#btn{
text-align:center;
}
.txt{
width:200px;
height:20px;
}
ÉÏÃæµÄÑùʽûÓÐÌØ±ðµÄµØ·½¡£»¶Ó´ó¼ÒÁôÑÔ¡£
Ïà¹ØÎĵµ£º
×î½ü,¾³£ÓÐÅóÓÑÎÊÎÒһЩ¹¤×÷ÖÐÓöµ½µÄCSSÎÊÌâ¡£ËûÃÇ×ÜÊDz»ÄܺܺõĿØÖÆCSS£¬Ó°ÏìCSSµÄЧÂÊ·¢»Ó¡£ÎÒÀ´·ÖÎö×ܽáһϴíÎóËùÔÚ£¬°ïÖú´ó¼Ò¸ü¼ÓÈÝÒ×ʹÓÃCSS¡£
±¾ÎÄ×ܽáÁËÎÒ¿ªÊ¼Ê¹ÓÃCSS²¼¾Ö·½·¨ÒÔÀ´ËùÓеļ¼ÇɺͼæÈÝ·½°¸£¬ÎÒÔ¸Òâ°ÑÕâЩÓëÄã·ÖÏí£¬ÎÒ»áÖØµã½âÊÍһЩÐÂÊÖÈÝÒ×·¸µÄ´íÎó(°üÀ¨ÎÒ×Ô¼ºÒ²·¸¹ýµÄ)£¬Èç¹ûÄãÒѾÊÇCSS¸ßÊÖ£¬ÕâÐ ......
ͨ¹ýÊ¹Ò³Ãæ¶¯Ì¬¼ÓÔØ²»Í¬CSSʵÏÖ¶à½çÃæ
·½·¨Ò»:
<%@page language="C#"%>
<%@import namespace="System.Data"%>
<script language="c#" runat="server">
public void page_load(Object obj,EventArgs e)
{
//´´½¨·þÎñÆ÷¶Ë¿Ø¼þ.
//Ö¸¶¨µÄ±ê¼Ç"LINK"³õʼ»¯´ËÀàµÄÐÂʵÀý.
HtmlGeneric ......
ÍøÒ³²ÉÓÃÁË UTF-8 ±àÂë¸ñʽ£¬Õâ±¾À´Ã»ÓÐÎÊÌ⣬ÎÊÌâÊÇÍⲿ CSS ÎļþĬÈÏÊÇ ANSI ±àÂ룬²¢Ã»Óб£´æÎª UTF-8 ¸ñʽ¡£¿ÉÄÜÄã»á·¢ÏÖÔÚÒ»°ãÇé¿öÏÂÕâÑùÒ²ÊÇûÓÐÎÊÌâµÄ£¬È»¶øµ± CSS ÎļþÖаüº¬ÓÐÖÐÎÄ×¢ÊÍʱ¾Í¿ÉÄܲ»¾¡ÈçÈËÒâÁË£¡
¡¡¡¡¹À¼ÆÊÇ IE6 °æ±¾ÒÔϵÄä¯ÀÀÆ÷ÔÚ½âÎöÕâ¸ö CSS ÎļþʱÒòΪ±àÂëÎÊÌâ¶øÎÞ·¨ÕýÈ·½âÎö£¬ËùÒԲŻᷢÉú CSS ......
1.divµÄ´¹Ö±¾ÓÖÐÎÊÌâ
vertical-align:middle;
½«ÐоàÔö¼Óµ½ºÍÕû¸öDIVÒ»Ñù¸ß line-height:200px;
È»ºó²åÈëÎÄ×Ö£¬¾Í´¹Ö±¾ÓÖÐÁË¡£È±µãÊÇÒª¿ØÖÆÄÚÈݲ»Òª»»ÐС£
2. margin¼Ó±¶µÄÎÊÌâ
ÉèÖÃΪfloatµÄdivÔÚieÏÂÉèÖõÄmargin»á¼Ó±¶¡£ÕâÊÇÒ»¸öie6¶¼´æÔÚµÄbug¡£
½â¾ö·½°¸ ......
ͼƬ×Ô¶¯ÊÊÓ¦´óСµÄÎÊÌâÔÚÆ½Ê±ÖÆ×÷µÄʱºòÊDZȽϳ£¼ûµÄÎÊÌ⣬ÏÂÃæÌṩһ¸ö±È½Ï¼òµ¥µÄ½â¾ö·½·¨£º
div img {
max-width:600px;
//IE7¡¢FFµÈÆäËû·ÇIEä¯ÀÀÆ÷ÏÂ×î´ó¿í¶ÈΪ600px;
width:600px;
//ËùÓÐä¯ÀÀÆ÷ÖÐͼƬµÄ´óСΪ600px;
width:expression(document.body.clientWidth>600?"600px":"auto");
//µ±Í¼Æ¬´óС´óÓÚ6 ......