How to create a blank HTML page?
To create a blank HTML page, you can use any text editor, such as Notepad, TextEdit, or Visual Studio Code.
- Open your text editor and create a new file.
- Save the file with a .html extension.
- In the file, type the following code:
HTML
<!DOCTYPE html>
<html>
<head>
<title>My Blank HTML Page</title>
</head>
<body>
</body>
</html>
This code is the basic structure of an HTML page. The <!DOCTYPE html>
declaration tells the browser that the document is an HTML document. The <html>
and </html>
tags enclose the entire HTML document. The <head>
and </head>
tags contain information about the document, such as the title. The <body>
and </body>
tags contain the content of the document, which is what the user will see when they open the page.
- Save the file and open it in a web browser. You should see a blank page with the title “My Blank HTML Page”.
You can now start adding content to your page by adding elements to the <body>
tag. For example, you could add a heading, some paragraphs of text, or an image.
Here is an example of a simple HTML page with some content:
HTML
<!DOCTYPE html>
<html>
<head>
<title>My HTML Page</title>
</head>
<body>
<h1>This is my HTML page!</h1>
<p>This is some text on my page.</p>
<img src="image.jpg" alt="My image">
</body>
</html>
When you open this page in a web browser, you should see a heading that says “This is my HTML page!”, followed by some text and an image.
You can learn more about HTML by visiting the W3Schools HTML tutorial.