rss· 投稿· 设为首页· 加入收藏· 繁體版
当前位置: 火魔网 » 程序开发 » html/css

CSS中文注释问题

最近客户网站几乎都完工了,由于开发环境是IE7和FF下,在IE7和FF下显示均正常,准备交工的时候,在公司电脑IE6下打开却发现某块不可显示CSS样式,该区CSS不起作用了,于是变查找一些方法,最终也没找到解决办法,于是我变找到CSS样式文件,进行层层删减测试,不管怎么删除 IE6下无任何反应,在我实在想不通的时候,我在这段CSS前加了一段中文注释 /*神奇的左边栏*/  , 在不经意的情况下IE6可以显示了.之前的注释上 /*左边边框*/,经过判断应该是这 "" 4个字 其中1个或几个字 造成CSS出现问题.我把这几字删除或在下面在加注释,IE6就正常了!

下面是CSS

/*左边边框*/
/*如果上面那4个字不删除,那么本段注释不可删除,如果删除IE6显示有问题*/
/*如果想让IE6可以显示下面的CSS 1:可以删除第一行注释或增加文字。经过测试 “左边边框” 或 “注” 这些字的组合会影响CSS在IE6下的显示*/

#border1 { text-align:left; }
#border1 #Top1{ height:37px;}
#border1 #Top1 a{color:#fff;}
#border1 #Top1 span{ background:url(border_bg.gif) no-repeat; height:37px; line-height:37px; width:50%; display:block; float:left;}
#border1 #Top1 .l font{ padding-left:25px; height:37px; line-height:37px; font-weight:bold; color:#fff; font-size:13px;}
#border1 #Top1 .r{ background:url(border_bg.gif) top right; height:37px; line-height:37px; width:50%; display:block; float:right;}
#border1 #Content1{ color:#E8E8E8; background:url(border_content_bg.gif) repeat-y;}
#border1 #sMain1 { padding:6px 5px 3px 5px;}
#border1 #sMain1 ul,li{ padding:0px; margin:0px;}
#border1 #sMain1 li{float:left; }
#border1 #sMain1 li a{ display:block; float:left; padding-left:10px; color:#C6C6C6;}
#border1 a:hover{ color:#fff; text-decoration:underline;}
#border1 #Bottom1{ height:12px; margin-bottom:10px;}
#border1 #Bottom1 span{ background:url(border_bg.gif) bottom left no-repeat;height:12px; display:block; width:50%; float:left;}
#border1 #Bottom1 .r{ background:url(border_bg.gif) bottom right; height:12px; display:block; width:50%; float:right;}

#border2 { text-align:left;}
#border2 #Top2{ height:37px;}
#border2 #Top2 a{color:#fff;}
#border2 #Top2 span{ background:url(border_bg.gif) no-repeat; height:37px; line-height:37px; width:50%; display:block; float:left;}
#border2 #Top2 .l font{ padding-left:25px; height:37px; line-height:37px; font-weight:bold; color:#fff; font-size:13px;}
#border2 #Top2 .r{background:url(border_bg.gif) top right no-repeat; height:37px; line-height:37px; width:50%; display:block; float:right;}
#border2 #Content2{ padding:5px 5px 3px 5px;color:#E8E8E8; background:url(border_content_bg.gif) repeat-y;}
#border2 #submenu a{ margin-left:5px;}
#border2 #sMain2 ul,li{ padding:0px;margin:0px;}
#border2 #sMain2 li{ float:left; width:180px; height:20px; line-height:20px; background:url(libg.gif) 1px 7px no-repeat; border-bottom:1px dotted #666; height:20px;}
#border2 #sMain2 li span{ display:block; float:right; font-size:9px; color:#999;}
#border2 #sMain2 li a{ float:left; padding-left:10px; text-decoration:underline; text-align:left; text-decoration:none; color:#C6C6C6;}
#border2 #sMain2 a:hover{ color:#fff; text-decoration:none;}
#border2 span{ display:block; font-size:9px; color:#60656A;}
#border2 #Bottom2{ height:12px; margin-bottom:10px;}
#border2 #Bottom2 span{ background:url(border_bg.gif) bottom left no-repeat; height:12px; display:block; width:50%; float:left;}
#border2 #Bottom2 .r{ background:url(border_bg.gif) bottom right; height:12px; display:block; width:50%; float:right;}

#border3 {text-align:left;background:url(bottom_bg.gif) no-repeat;color:#292829}
#border3 a{color:#292829;}
#border3 #Top3{ display:none;}
#border3 #Content3{ padding-top:8px;}
#border3 #Content3 sMain{ padding-left:15px;}
#border3 #Bottom3{margin-bottom:20px;height:5px;}


 

顶一下
(0)
踩一下
(0)