是否可以仅将样式表添加到内容页?

发布于 2024-12-15 02:15:24 字数 538 浏览 2 评论 0原文

在 asp.net webforms 项目中,我只需要向内容页面添加外部样式表,

如果我将 css 链接放在 <%@ Page> 声明之后,则会出现错误,指出

Error   103 Validation (XHTML 1.0 Transitional): Content is not supported outside 'script' or 'asp:content' regions.

If I put it 标记内错误是

Error   104 Cannot switch views: Validation (XHTML 1.0 Transitional): Element 'link' cannot be nested within element 'td'.

Is it possible to add a stylesheet only to content page?

In a asp.net webforms project, I need to add external style sheet only to content page,

If I put css link after the <%@ Page> declaration it gives an error saying

Error   103 Validation (XHTML 1.0 Transitional): Content is not supported outside 'script' or 'asp:content' regions.

If I put it inside <asp:Content> tag error is

Error   104 Cannot switch views: Validation (XHTML 1.0 Transitional): Element 'link' cannot be nested within element 'td'.

Is it possible to add a style sheet only to content page?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独行侠 2024-12-22 02:15:24

您应该在母版页的头部部分创建一个占位符。然后在内容页面中,如果你想包含js,css,...放在这个占位符上,除非将其保留为空。

You should create a place holder in the head section in master page. Then in the content page, if you want to include js, css, ... put on this place holder, unless keep it empty.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文