html_editors.asp

html_basic.asp

Creating, saving, and viewing HTML documents is fundamental to web development. Here’s a step-by-step guide on how to manage HTML files, apply structural and common tags, and use formatting techniques to enhance your web pages.

1. Creating and Saving HTML Documents

Creating an HTML Document

  1. Choose a Text Editor: You can use any text editor to create HTML files, such as Notepad, Sublime Text, Visual Studio Code, or Atom.

  2. Write HTML Code: Start by writing your HTML code in the editor. Here’s a basic structure:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>My First HTML Page</title>
    </head>
    <body>
        <h1>Hello, World!</h1>
        <p>This is my first HTML document.</p>
    </body>
    </html>
    
    
  3. Save the Document: Save your file with a .html extension. For example, index.html.

Viewing an HTML Document

  1. Open in a Browser: Locate the saved .html file in your file explorer, right-click on it, and select Open with followed by your preferred web browser (e.g., Chrome, Firefox).
  2. Drag and Drop: Alternatively, you can drag the file directly into an open browser window.

2. Applying Structure Tags

HTML documents are structured with various tags to create a logical flow and improve readability.

Basic Structure Tags

Example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Structured HTML Document</title>
</head>
<body>
    <header>
        <h1>Welcome to My Website</h1>
    </header>
    <nav>
        <ul>
            <li><a href="#home">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
        </ul>
    </nav>
    <main>
        <section>
            <h2>About Us</h2>
            <p>This is the about section.</p>
        </section>
        <section>
            <h2>Contact Us</h2>
            <p>This is the contact section.</p>
        </section>
    </main>
    <footer>
        <p>&copy; 2024 My Website</p>
    </footer>
</body>
</html>

3. Applying Common Tags and Attributes