链接CSS文件内容页 [英] Links css file to a content page

查看:96
本文介绍了链接CSS文件内容页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的母版页和一些内容的网页。

我想不同的css文件分配给每个内容页面。

I have Master page and some content pages.
I want to assign different css file to each of the content pages.

(不使用主题)

我该怎么做?

(without using themes)
How can I do that?

推荐答案

我没有,一旦通过在母版页添加页眉占位符,并明确规定在内容页面的CSS。

I did that once by adding a header-placeholder in the master-page, and explicitly specifying the css in the content-pages.

在站长:

<head runat="server">
    <title></title>
    <link href="~/css/common.css" rel="stylesheet" type="text/css" />
    <!-- loads of other stuff / -->
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>

和在内容:

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
        <link href="../css/SomeContent.css" rel="stylesheet" type="text/css" />
        <script src="../js/SomeJsToo.js" type="text/javascript"></script>
</asp:Content>

这篇关于链接CSS文件内容页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆