这是我的asp代码
<link id="Link1" rel="stylesheet" runat="server" media="screen" href="~/Styles/css/tableStyle.css" />
<link id="Link2" rel="stylesheet" runat="server" media="screen" href="~/Styles/css/LoadingStyle.css" />
<link id="Link3" rel="stylesheet" runat="server" media="screen" href="~/Styles/css/selectStyle.css" />
Run Code Online (Sandbox Code Playgroud)
页面打开但没有样式,我的意思是表格和选择没有我为它们制作的样式。
在 google chrome 上点击 f12 所以我得到了这些错误:
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:31200/~/Styles/css/selectStyle.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:31200/~/Styles/css/LoadingStyle.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:31200/~/Styles/css/tableStyle.css
Run Code Online (Sandbox Code Playgroud)
那是因为如果您浏览到http://localhost:31200/~/Styles/css/selectStyle.css没有这样的资源。
你可能想要http://localhost:31200/Styles/css/selectStyle.css. 因此,删除~您的符号href:
<link id="Link1" rel="stylesheet" runat="server" media="screen" href="/Styles/css/tableStyle.css" />
<link id="Link2" rel="stylesheet" runat="server" media="screen" href="/Styles/css/LoadingStyle.css" />
<link id="Link3" rel="stylesheet" runat="server" media="screen" href="/Styles/css/selectStyle.css" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13827 次 |
| 最近记录: |