开发学院WEB开发ASP.NET 关于.net中页面CSS样式丢失的解决方案 阅读

关于.net中页面CSS样式丢失的解决方案

 2008-12-12 17:24:46 来源:WEB开发网 闂傚倸鍊搁崐椋庢濮橆兗缂氱憸宥堢亱闂佸湱铏庨崰鏍不椤栫偞鐓ラ柣鏇炲€圭€氾拷闂傚倸鍊搁崐椋庣矆娓氣偓楠炲鏁撻悩鎻掔€梺姹囧灩閻忔艾鐣烽弻銉︾厵闁规鍠栭。濂告煕鎼达紕校闁靛洤瀚伴獮鎺楀箣濠靛啫浜鹃柣銏⑶圭壕濠氭煙閻愵剚鐏辨俊鎻掔墛缁绘盯宕卞Δ鍐冣剝绻涘畝濠佺敖缂佽鲸鎹囧畷鎺戭潩閹典焦鐎搁梻浣烘嚀閸ゆ牠骞忛敓锟�婵犵數濮烽弫鍛婃叏椤撱垹绠柛鎰靛枛瀹告繃銇勯幘瀵哥畼闁硅娲熷缁樼瑹閳ь剙岣胯鐓ら柕鍫濇偪濞差亜惟闁宠桨鑳堕崝锕€顪冮妶鍡楃瑐闁煎啿鐖奸崺濠囧即閵忥紕鍘梺鎼炲劗閺呮稒绂掕缁辨帗娼忛埡浣锋闂佽桨鐒﹂幑鍥极閹剧粯鏅搁柨鐕傛嫹闂傚倸鍊搁崐椋庢濮橆兗缂氱憸宥堢亱闂佸湱铏庨崰鏍不椤栫偞鐓ラ柣鏇炲€圭€氾拷  闂傚倸鍊搁崐鐑芥嚄閼哥數浠氱紓鍌欒兌缁垶銆冮崨鏉戠厺鐎广儱顦崡鎶芥煏韫囨洖校闁诲寒鍓熷铏圭磼濡搫顫嶅銈嗗姉閸樠囧煡婢跺á鐔兼煥鐎n兘鍋撴繝姘拺鐟滅増甯掓禍浼存煕閹惧鈽夐柍缁樻煥椤繈鎳滅喊妯诲闂備礁鎲$粙鎴︺偑閺夋垟鏋旈柡鍐e亾缂佺粯绋撴禒锕傚磼濮橆剦鐎抽梻浣哥-缁垶骞戦崶顒傚祦閻庯綆浜栭弨浠嬫煙闁箑澧い鏂垮€规穱濠囨倷椤忓嫧鍋撻弽褜娼栧┑鐘宠壘閸屻劎鎲歌箛娑樼疅闁圭虎鍠楅弲鎼佹煥閻曞倹瀚�
核心提示:最近在做一使用.net开发小站点的时候,发现放入.net代码之后页面特定区域定义好的CSS样式莫名其妙的没了,关于.net中页面CSS样式丢失的解决方案,找了很多方法,结果发现居然是CSS里的注释惹的祸,方案总结如果在.net加代码的时候发现定义CSS样式效果丢失,在确定没有其它问题的情况下试着删除一些丢失样式附近的C

最近在做一使用.net开发小站点的时候,发现放入.net代码之后页面特定区域定义好的CSS样式莫名其妙的没了,找了很多方法,结果发现居然是CSS里的注释惹的祸。
原CSS代码如下view plaincopy to clipboardPRint?
/*右侧区域*/ 
.RightPart{width:230px;margin-top:10px;} 
.RightPart{text-align:left;} 
.RightPart .Title{background:url(../images/RightPartTitle.gif) no-repeat left top;padding-left:32px;height:47px;} 
.RightPart .TitleR{background:url(../images/RightPartTitleRed.gif) no-repeat left top;padding-left:32px;height:47px;} 
.RightPart .TitleG{background:url(../images/RightPartTitleG.gif) no-repeat left top;padding-left:32px;height:47px;} 
.RightPart h3{font-size:14px;color:#FFF;} 
.RightPart .LeftBorder{width:8px;background:url(../images/make_default_2_1.jpg) repeat-y left top;} 
.RightPart .RightBorder{width:9px;background:url(../images/make_default_2_2.jpg) repeat-y right top;} 
.RightPart .Content{width:205px;padding:0 5px;} 
.RightPart ul{list-style:none;} 
.RightPart li{display:block;background:url(../images/page_story_icon_ball.jpg) no-repeat left 3px;padding:3px 0 3px 15px;} 
/*地图分类*/ 
.RightPart .Category li{font-size:16px;font-weight:bold;background:url(../images/page_story_icon_ball.jpg) no-repeat left 5px;margin:4px 0 4px 10px;} 
.RightPart .Category .Line{background:left top;padding:0;margin:0 0 0 3px !Important;margin:-13px 0 0 3px;width:auto;height:4px;} 

/*右侧区域*/
.RightPart{width:230px;margin-top:10px;}
.RightPart{text-align:left;}
.RightPart .Title{background:url(../images/RightPartTitle.gif) no-repeat left top;padding-left:32px;height:47px;}
.RightPart .TitleR{background:url(../images/RightPartTitleRed.gif) no-repeat left top;padding-left:32px;height:47px;}
.RightPart .TitleG{background:url(../images/RightPartTitleG.gif) no-repeat left top;padding-left:32px;height:47px;}
.RightPart h3{font-size:14px;color:#FFF;}
.RightPart .LeftBorder{width:8px;background:url(../images/make_default_2_1.jpg) repeat-y left top;}
.RightPart .RightBorder{width:9px;background:url(../images/make_default_2_2.jpg) repeat-y right top;}
.RightPart .Content{width:205px;padding:0 5px;}
.RightPart ul{list-style:none;}
.RightPart li{display:block;background:url(../images/page_story_icon_ball.jpg) no-repeat left 3px;padding:3px 0 3px 15px;}
/*地图分类*/
.RightPart .Category li{font-size:16px;font-weight:bold;background:url(../images/page_story_icon_ball.jpg) no-repeat left 5px;margin:4px 0 4px 10px;}
.RightPart .Category .Line{background:left top;padding:0;margin:0 0 0 3px !Important;margin:-13px 0 0 3px;width:auto;height:4px;}  丢失的就是“/*地图分类*/”下面两行的CSS效果。
  把“/*地图分类*/”的注释去除了,结果F5一下居然发现页面正常了  看来之前遇到的问题也是一样啊。

方案总结
  如果在.net加代码的时候发现定义CSS样式效果丢失,在确定没有其它问题的情况下试着删除一些丢失样式附近的CSS注释,就可以解决问题。

Tags:关于 net 页面

编辑录入:爽爽 [复制链接] [打 印]
[]
  • 好
  • 好的评价 如果觉得好,就请您
      0%(0)
  • 差
  • 差的评价 如果觉得差,就请您
      0%(0)
赞助商链接