当前位置: 代码迷 >> ASP.NET >> aspx引入样式表的有关问题
  详细解决方案

aspx引入样式表的有关问题

热度:4942   发布时间:2013-02-25 00:00:00.0
aspx引入样式表的问题
美工做好页面,样式没有问题。我把页面转成aspx后,样式没有了。除非把
<link href="css/index.css" rel="stylesheet" type="text/css" />
转成
<link href="../css/index.css" rel="stylesheet" type="text/css" />
是不是aspx引用css时找不到路径啊??这个问题遇到很多次了。

------解决方案--------------------------------------------------------
你试下<link href="/css/index.css" rel="stylesheet" type="text/css" /> 

或你用VS2005以上的版本话直接用THEME文件夹
然后在page_preInit里指明theme就可以了

------解决方案--------------------------------------------------------
路径问题,~/***
------解决方案--------------------------------------------------------
~/
------解决方案--------------------------------------------------------
使用theme,你无需写<link>代码。只要在
HTML code
<%@ Page %>
  相关解决方案