This HTML document sets up a simple web page with a title of "Loop-web" and includes a link to an external stylesheet named "styles.css". The JavaScript code in the <script> tag at the end of the body will redirect the user to a specified website after a delay.
Here's an explanation of the code:
-
The HTML structure includes the necessary elements for a basic webpage: a doctype declaration, opening and closing , , and tags.
-
In the section:
- The character set is set to UTF-8.
- The viewport meta tag is included for responsive design.
- The title of the page is set to "Loop-web".
- A link to an external stylesheet named "styles.css" is included for styling the page.
-
In the section:
- A <script> tag is used to include an external JavaScript file named "script.js". This script contains the code that will redirect the user to a specified website after a delay.
-
The JavaScript code in "script.js":
- Uses setTimeout to execute a function after a specified delay (in this case, 3000 milliseconds or 3 seconds).
- Inside the function, window.location.href is set to 'https://ivucb4t.github.io/Loop-web/', which will redirect the user's browser to the specified URL after the delay.
When a user visits this webpage, they will see the content of the page briefly before being automatically redirected to the specified website (https://ivucb4t.github.io/Loop-web/) after a 1-second delay.