- Courses
- HTML
- HTML top level tags
- <noscript>
- Noscript element in head
What is the role of the <noscript>
element in the following code?
<head>
<noscript>
<style>
body { background-color: #f3f3f3; }
</style>
</noscript>
</head>
The <noscript>
element provides alternative styles when scripting is disabled.
In the provided code, the <noscript>
element contains a <style>
block that changes the background color of the page. This style is applied only when scripting is disabled, ensuring that the page maintains a specific appearance even without JavaScript support.
<head>
<noscript>
<style>
body { background-color: #f3f3f3; }
</style>
</noscript>
</head>