ModeratelyRetro
ModeratelyRetro

Reputation: 65

Link a Stylesheet (CSS) outside of the HEAD Tag

I have seen a number of questions regarding this issue and I have yet to see the response I am looking for. I simply want to know if it is possible to link to an external stylesheet anywhere else other than the HEAD tag.

The reason I ask, is I have to use Confluence to document and the addons our company uses are very basic. I wanted to style my page but the issue is that Confluence innately overrides any HEAD tag and inserts its own. There is no way to get around this without the HTML addon, which my company will not purchase.

To get around this, I have to include a large STYLE tag with all of the styled customizations so it can get fairly long.

I am just looking to see if it is possible and how to link a stylesheet anywhere else in the HTML other than the HEAD tag. (I am aware that this is not common or good practice, and I also understand the reasons for having the stylesheet in the HEAD tag so please no comments regarding this.)

Upvotes: 3

Views: 3932

Answers (1)

Pa Ye
Pa Ye

Reputation: 1838

Yes, it's possible to include a stylesheet somewhere else other than <head> - precisely, you can place it inside <body>. To quote 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.

Upvotes: 8

Related Questions