我正在尝试在我的 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>
在我后面的代码中,我将 href 属性添加到CssFile
:
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>