- Courses
- HTML
- HTML top level tags
- <link>
- Using the link element in the body
Can the <link>
element be used within the <body>
tag?
The <link>
element can be used in the <body>
tag for certain link types.
While the <link>
element is typically placed in the <head>
section, it can be used in the <body>
tag if the link type is body-ok, such as rel="stylesheet"
. However, it's generally best practice to keep <link>
elements in the <head>
to maintain a clear separation between metadata and content.
<body>
<link rel="stylesheet" href="style.css" />
</body>