Link HEAD 标记外的样式表 (CSS)

Link a Stylesheet (CSS) outside of the HEAD Tag

我已经看到很多关于这个问题的问题,但我还没有看到我正在寻找的回复。我只是想知道是否可以 link 到 HEAD 标记以外的任何其他地方的外部样式表。

我之所以问,是因为我必须使用 Confluence 来记录,而我们公司使用的插件非常基础。我想设计我的页面样式,但问题是 Confluence 天生会覆盖任何 HEAD 标签并插入它自己的标签。没有 HTML 插件就无法解决这个问题,我公司不会购买它。

为了解决这个问题,我必须包含一个带有所有自定义样式的大型 STYLE 标签,这样它就可以变得相当长。

我只是想看看是否有可能以及如何 link 在 HTML 中除 HEAD 标记之外的任何其他地方创建样式表。 (我知道这不是常见的或好的做法,我也理解在 HEAD 标记中使用样式表的原因,所以请不要对此发表评论。)

是的,可以在 <head> 以外的其他地方包含样式表 - 准确地说,您可以将它放在 <body> 中。引用 MDN:

A <link> tag can occur either in the head element or in the body element (or both), depending on whether it has a link type that is body-ok. For example, the stylesheet link type is body-ok, and therefore a <link rel="stylesheet"> is permitted in the body.