HTML

Introduction to Web and HTML

How the Web Works What is HTML Why Learn HTML

Creating Your First HTML Page

Creating Your First HTML Page

Now, let's create your very first HTML page. Follow these simple steps to build a basic HTML document:

Step 1: Set Up a Text Editor

You can create HTML documents using any text editor. Common text editors include Notepad (Windows), TextEdit (Mac), Visual Studio Code, Sublime Text, or any other code editor of your choice. Open your preferred text editor to get started.

Step 2: Create the HTML Structure

Every HTML document starts with a basic structure. Type or copy the following code into your text editor:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Your First HTML Page</title>
  </head>
  <body>
    <h1>Hello, World!</h1>
    <p>This is your first HTML page. Congratulations!</p>
  </body>
</html>

This code follows the standard HTML structure, including the <!DOCTYPE html> declaration, the <html> root element, the <head> section with metadata, and the <body> section for the main content.

Step 3: Save Your Document

Save your document with an .html extension. For example, you can save it as first.html. Choose a location on your computer where you want to save the file.

Step 4: Open Your HTML Page

Now that you've saved your HTML file, open it in a web browser. You can do this by double-clicking the file in your file explorer. Your web browser will render the HTML and display your web page. You should see a page with the title "Your First HTML Page," a heading that says "Hello, World!" and a paragraph below it.

Congratulations! You've created and viewed your first HTML web page.

Step 5: Experiment and Learn

As you become more familiar with HTML, you can experiment with adding more content, using different HTML elements, applying CSS for styling, and even adding interactivity with JavaScript. HTML is the foundation of web development, and there's a lot to explore and learn.

Remember that the best way to become proficient is through practice. As you create more web pages and experiment with different elements, you'll gain confidence and experience in web development.