<noscript> Tag Syntax
Rules for coding HTML noscript
elements
<head> ... metadata content ... <noscript> ... metadata content ... </noscript> ... metadata content ... </head> <body> ... ... flow content expected ... <noscript> ... flow content ... </noscript> ... ... phrasing content expected ... <noscript> ... phrasing content ... </noscript> ... </body>
Rules for coding the HTML noscript element
Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.
noscript element as metadata content
- Code the <noscript> tag in the <head> section of the HTML document where metadata content is expected.
- Begin the noscript element with a starting <noscript> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlns
attribute on the <html> tag. - Include any global attributes inside the starting <noscript> tag as appropriate.
- Inside the noscript element, between the <noscript> start tag and the </noscript> end tag, code the alternate metadata for when scripts are disabled..
- End the noscript element with a matching
</noscript>
closing tag.
noscript element in the body
- Code the <noscript> tag in the <body> section of the HTML document where either flow content or phrasing content is expected.
- Begin the noscript element with a starting <noscript> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the
xmlns
attribute on the <html> tag. - Include any global attributes inside the starting <noscript> tag as appropriate.
- Inside the noscript element, between the <noscript> start tag and the </noscript> end tag, code the alternate content for when scripts are disabled. If the
<noscript>
tag is coded where flow content is permitted, then the inner HTML of the<noscript>
tag may contain flow content, otherwise it is restricted to phrasing content. - End the noscript element with a matching
</noscript>
closing tag.
<noscript> Content Model
Contents of the noscript element
When coded in metadata content
When coded in metadata content, the content of the noscript element can include <link/> tags, <meta/> tags and style elements.
When coded in flow content
When coded in flow content, the content of the noscript element can include HTML comments, text content and any HTML tags that can be used in flow content.
When coded in phrasing content
When coded in phrasing content, the content of the noscript element can include HTML comments, text content and only those HTML tags that can be used in phrasing content.