CSS ´¹Ö±¾ÓÖÐ
1.ͼƬµÄ´¹Ö±¾ÓÖÐ
.box
{
/*·ÇIEµÄÖ÷Á÷ä¯ÀÀÆ÷ʶ±ðµÄ´¹Ö±¾ÓÖеķ½·¨*/
display: table-cell;
vertical-align: middle; /*ÉèÖÃˮƽ¾ÓÖÐ*/
text-align: center;
/* Õë¶ÔIEµÄHack */
*display:block;
*font-size:175px;/*ԼΪ¸ß¶ÈµÄ0.873£¬200*0.873 ԼΪ175*/
*font-family:Arial;/*·ÀÖ¹·Çutf-8ÒýÆðµÄhackʧЧÎÊÌ⣬Èçgbk±àÂë*/
width:200px;
height:200px;
border:1px solid #eee;
}
.box img
{
/*ÉèÖÃͼƬ´¹Ö±¾ÓÖÐ*/
vertical-align: middle;
}
<div class="box">
<img src="http://pics.taobao.com/bao/album/promotion/taoscars_180x95_071112_sr.jpg" mce_src="http://pics.taobao.com/bao/album/promotion/taoscars_180x95_071112_sr.jpg" />
</div>
²Î¿¼ÎÄÕ£º
http://www.planabc.net/2008/05/26/img_vertical_center_solution/
http://www.student.oulu.fi/~laurirai/www/css/middle/
Ïà¹ØÎĵµ£º
ǰÑÔ£ºCSS²¼¾ÖÓ봫ͳ±í¸ñ(table)²¼¾Ö×î´óµÄÇø±ðÔÚÓÚ£ºÔÀ´µÄ¶¨Î»¶¼ÊDzÉÓñí¸ñ£¬Í¨¹ý±í¸ñµÄ¼ä¾à»òÕßÓÃÎÞɫ͸Ã÷µÄGIFͼƬÀ´¿ØÖÆÎIJ¼¾Ö°æ¿éµÄ¼ä¾à£»¶øÏÖÔÚÔò²ÉÓòã(div)À´¶¨Î»£¬Í¨¹ý²ãµÄmargin,padding,borderµÈÊôÐÔÀ´¿ØÖưæ¿éµÄ¼ä¾à¡£
(Ò») CSS2ºÐÄ£ÐÍ
ºÐÄ£ÐÍÖ÷Òª¶¨ÒåËĸöÇøÓò£ºÄÚÈÝ(content)¡¢±ß¿ò¾à(paddin ......
ÔÚDIV+CSSµÄʱ´úÀӵÓÐÒ»¸öÌùÐĵÄCSSÊÖ²á»á¼«´óµÄÔö¼ÓÍøÒ³Éè¼ÆµÄЧÂÊ¡£Ä¿Ç°ÊÐÃæÉÏ´ó¼ÒÓõÄ×î¶àµÄ¾ÍÊÇËÕÉòСÓêÖÆ×÷µÄ¡¶CSS 2.0ÖÐÎÄÊֲᡷ£¬ÎÒÒ²Ò»Ö±ÓÃÁËÓÐËÄÎåÄêÁË¡£ÊÖ²áʹÓÃCHM¸ñʽ£¬ÄÚÈݷdz£µÄ·á¸»£¬¼¸ºõ°üÀ¨ÁËCSS2µÄËùÓÐÄÚÈÝ¡£
ÏÂÔØµØÖ·
http://www.javatang.com/_download/css2handbook.rar ......
clip:rect(ÉÏ£¬ÓÒ£¬Ï£¬×ó) Ëĸöµã×ø±ê
<img src="1.jpg" style=" clip:rect(0£¬30£¬10£¬10);"/>
´Ë·½·¨²»ÊʺϼôÇб³¾°
±³¾°Ê¹ÓÃ
style="background-image:url(bg.jpg); background-position:20px 0px;"
kground-position:
1.¶¨Î»·½·¨ left center ºáÏò ×ÝÏò
2.ÇÐÈ¡ ºáÏòpx ×ÝÏòpx
²»ÊÊºÏÆ ......
¹ØÓÚCSS¶Ô¸÷¸öä¯ÀÀÆ÷¼æÈÝÊǸö·Ç³£ÈÃÈËÍ·ÌÛµÄÊÂÇéÁË, ÍøÂçÉÏµÄ½Ì³Ì±éµØ¶¼ÊÇ.½ñÌìÔÚdiscuz.netÉÏ·¢ÏÖÁËһƪ²»´íµÄ¶«Î÷£¬¾Í×ªÔØ¹ýÀ´ºÍ´ó¼Ò¹²Ïí.¿ÉÒÔµ±×÷CSS¼æÈÝIE6,IE7,FireFoxµä·¶ÁË£¬ÖµµÃÈ¥¼Ç¼Ï¡£·¢ÏÖ×Ô¼ººÜ¾ÃûÓÐ×ªÔØ¶«Î÷¡£
×¢£ºIE¶¼ÄÜʶ±ð*;±ê×¼ä¯ÀÀÆ÷(ÈçFirefox,Opera,Netscape)²»ÄÜʶ±ð*£»IE6ÄÜʶ±ð*£¬µ«²»ÄÜʶ±ð !im ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<!-- www.div-css.com ÍøÕ¾±ê×¼»¯ 2007-4-16 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
......