»ñÈ¡¶ÔÏóCSSÊôÐÔ
//»ñÈ¡Ò»¸öÌض¨ÔªËصÄÑùʽÊôÐÔ
function getStyle(elem,name){
//Èç¹û¸ÃÊôÐÔ´æÔÚÓÚstyleÖÐ ÔòËû×î½ü±»ÉèÖùý
if(elem.style[name]){
return elem.style[name];
}
//·ñÔò³¢ÊÔIE·½·¨
else if(elem.currentStyle){
return elem.currentStyle[name];
//W3C·½·¨
}else if(document.defaultview && document.defaultView.getComputedStyle){
name=name.repalce("/([A-Z])/g","-$1");
name=name.toLowerCase();
var s = document.defaultView.getComputedStyle(elem,"");
return s && s.getPropertyValue(name);
}else{
return null;
}
}
Ïà¹ØÎĵµ£º
Ò³ÃæÉϵÄcssÁ´½Ó ÈçÏÂ
<link href="../style/style.css" rel="stylesheet" type="text/css" />
µ±a.actionͨ¹ýÖض¨Ïòredirect µ½ÁíÒ»¸öb.actionºó£¬½øÈëÏÂÒ»¸öjspÒ³Ã棬´ËʱcssºÍÒ³ÃæµÄͼƬ¶¼Ê§Ð§¡£
ºóÀ´°ÑjspÀïÃæµÄcss·¾¶¡¢Í¼Æ¬Â·¾¶¸ÄΪ¾ø¶Ô·¾¶£¬¾Í°ÑÎÊÌâ½á¾ÖÁË¡£
<link href="/BookShop/style/style.css" ......
ºÜ¶àÕ¾³¤¶¼±§Ô¹CSS¶Ôä¯ÀÀÆ÷µÄ¼æÈÝÐÔÓÐʱÈÃÈ˺ÜÍ·ÌÛ,ÓÈÆäÊǶÔÓÚIE6Õâ¸öÎÊÌâ¶à¶àµÄä¯ÀÀÆ÷°æ±¾¡£»òÐíµ±ÄãÁ˽⵱Öеļ¼ÇɸúÔÀí,¾Í»á¾õµÃÒ²²»ÊÇÄÑÊÂ,´ÓÍøÉÏÊÕ¼¯ÁËIE7,6ÓëFireofxµÄ¼æÈÝÐÔ´¦Àí·½·¨²¢ÕûÀíÁËÒ»ÏÂ.¶ÔÓÚweb2.0µÄ¹ý¶È,Ç뾡Á¿ÓÃxhtml¸ñʽд´úÂë,¶øÇÒDOCTYPE Ó°Ïì CSS ´¦Àí,×÷ΪW3CµÄ±ê×¼,Ò»¶¨Òª¼ÓDOCTYPEÉùÃ÷. &nb ......
ʹÓÃTable²¼¾ÖÒ³ÃæΪʲôÊDz»Ã÷Öǵģ¿
´ó¼Ò¿´µ½±êÌ⣬²»ÒªÎó½âÈÏΪÔÚÒ³ÃæÖв»ÄÜʹÓÃTable£¬¶øÊÇ¿ÉÒÔ
ʹÓÃTable£¬µ«ÊǾ¡Á¿²»ÒªÓÃTableÈ¥²¼¾ÖÒ³Ã棬ΪʲôÕâô˵ÄØ£¬ÒòΪʹÓÃTable²¼¾ÖÒ³Ãæ»áʹҳÃæʧȥÁé»îÐÔ£¬Ôõô¸öÁé»î·¨ÄØ£¬±ÈÈç½ñÌìÄãºÃ²»
ÈÝÒ××ö³öÀ´µÄÒ³Ã棬µÚ¶þÌìÀÏ°å˵ÎÒ²»Ï²»¶µÇ¼ģ¿é·Åµ½Óұߣ¬»¹ÊǷŵ½×ó±ß£¬Í¨Ö ......
ÉϽڿÎÎÒÃǽ²ÁËÒ»ÏÂCssͨ¹ýʲô·½Ê½È¥¿ØÖÆÒ³Ãæ
£¬Èç¹û²»¼ÇµÃ£¬ÎÒÀ´°ï´ó¼Ò»ØÒäһϣ¬×ܹ²ÓÐËÄÖÖ·½Ê½ÐÐÄÚ·½Ê½¡¢ÄÚ
Ƕ·½Ê½¡¢Á´½Ó·½Ê½¡¢µ¼È뷽ʽ£¬´ó¼Òͨ¹ýÕâËÄÖÖ·½Ê½¾Í¿ÉÒÔʵÏÖCSS
¶ÔHTML
Ò³ÃæÑùʽµÄ¿ØÖÆ£¬Èç¹ûÒªÈÃÕâЩÑùʽ¶ÔHTMLÒ³ÃæÖеÄÔªËØʵÏÖÒ»¶ÔÒ»£¬Ò»¶Ô¶à»òÕ߶à¶ÔÒ»µÄ¿ØÖÆ£¬Õâ¾ÍÐè
ÒªÓõ½CSSÑ¡ÔñÆ÷£¬HTMLÒ³ÃæÖеÄÔ ......
<html>
<head>
<mce:style type="text/css"><!--
div.container
{
width:100%;
margin:0px;
border:1px solid gray;
line-height:150%;
}
div.header,div.footer
{
padding:0.5em;
color:white;
background-color:gray;
clear:left;
}
h1.header
{
padding:0;
margin:0;
}
div. ......