gpt4 book ai didi

c# - 无法引用外部 CSS

转载 作者:行者123 更新时间:2023-11-28 13:25:34 24 4
gpt4 key购买 nike

我正在尝试在我的 site.master 页面上使用来自 CDN 的 CSS 文件。 CSS 位于 http://cdn.meriranchi.com/styles/site.css。我已经尝试了下面的许多变体,但我没有运气。

site.master 具有以下标记:

<head runat="server">
<title>::MeriRanchi:: Ranchi ka search engine. Ranchi's 1st of its kind, City Search.
Search for the shops, institutes , tourist spots , emergency services etc with ease.
</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" id="CssFile" runat="server"/>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>

在我后面的代码中,我向 CssFile 添加了一个 href 属性:

CssFile.Attributes.Add("href","http://cdn.meriranchi.com/Styles/Site.css");

以上代码在 IE9 中呈现以下 HTML:

<head><title>
::MeriRanchi:: Ranchi ka search engine. Ranchi's 1st of its kind, City Search.
Search for the shops, institutes , tourist spots , emergency services etc with ease.

</title><link rel="shortcut icon" href="favicon.ico" /><link id="CssFile" rel="stylesheet" type="text/css" href="http://cdn.meriranchi.com/Styles/Site.css" /><meta name="description" content="schools and colleges in ranchi,restaurants in ranchi,coaching institutes in ranchi,shopping complex in ranchi,shopping mall in ranchi,best cloth store in ranchi
best college in ranchi,best school in ranchi,showrooms in ranchi,authorised dealers in ranchi,grocery stores in ranchi,falls in ranchi,tourist places in ranchi,zoo in ranchi,tourist spots in ranchi,
schools and colleges, BIT Mesra, RINPAS, CIP Ranchi, Ranchi Mental Hospital, HEC, dams in ranchi, jagannathpuri rath mela, hadia, hadiya, hariya, morhabadi maidaan, firayalal chowk,
" /><meta name="keywords" content="tourist places in ranchi, tourist spots in ranchi, business listings in ranchi, shops in ranchi, schools colleges in ranchi, restaurants in ranchi, movies in ranchi, jobs in ranchi,real estate deals in ranchi" />
</head>

最佳答案

您的浏览器很可能认为它已经拥有您的外部 CSS 文件的副本。您可以通过在浏览器的开发人员工具中观察网络请求流量来检查这一点,以确保它正在请求文件的新副本。

如果浏览器不是您应该通过 pressing CTRL + F5 刷新整个页面.

关于c# - 无法引用外部 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13959924/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com