[英]Where to add Link tags on a page that's got a master page?
當我在這里輸入時: -
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<link href="Skins/SkinCustom/Editor.Default.css" rel="stylesheet" type="text/css" />
</asp:Content>
它說Element Link不能嵌套在div中......我應該如何鏈接我的css文件?
在主人的head
標簽中添加ContentPlaceHolder:
<head>
<asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder>
</head>
然后在您的內容頁面中:
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link href="Skins/SkinCustom/Editor.Default.css" rel="stylesheet" type="text/css" />
</asp:Content>
如果您的母版頁沒有在<head>
部分提供內容占位符(編輯:您無法編輯它) ,那么您可能會失敗。
查看母版頁源並查看其他可用的內容占位符。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.