日期:2014-05-18  浏览次数:20455 次

IIS发布网站后,div网页中css失效问题
感觉是相对路径的问题,但是自己真的不知道怎么改,结构如下
MasterPage页中,调用代码
HTML code
<script src="../js/public.js"type="text/javascript"></script>

    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../css/top_css.css" rel="stylesheet" type="text/css" />
    <link href="../ext-3.0.0/resources/css/ext-all.css"rel="stylesheet" type="text/css" />

    <script src="../ext-3.0.0/adapter/ext/ext-base.js" type="text/javascript"></script>

    <script src="../ext-3.0.0/ext-a.js" type="text/javascript"></script>

    <script src="../js/main.js" type="text/javascript"></script>

    <link href="../css/html.css" rel="Stylesheet" type="text/css" />
    <link href="../css/menu.css" rel="Stylesheet" type="text/css" />

高手帮我瞧瞧

------解决方案--------------------
你都改成这样:

CSS:
<link href="~/css/main.css" rel="stylesheet" type="text/css" runat="server" />

Script:
<script src='<%=ResolveUrl("~/ext-3.0.0/adapter/ext/ext-base.js") %>' type="text/javascript"></script>