Web Development (Session 02)

Shape Image One

HOW TO
USE AN IDE TO
BUILD WEBSITES

Introduction

Integrated Development Environments (IDEs) are powerful tools that streamline the coding process by providing various features such as syntax highlighting, code suggestions, and debugging tools. This section will teach you how to use an IDE to create a basic HTML webpage.

What is an IDE?

Definition:

An IDE is a software application that provides comprehensive facilities to computer programmers for software development. It typically includes a code editor, a debugger, and build automation tools.

Popular IDEs for Web Development:

  • Visual Studio Code
  • Sublime Text
  • Atom
  • Brackets

Installing Visual Studio Code (VS Code)

Download and Install:
  • Visit the Visual Studio Code website.
  • Download the installer for your operating system (Windows, macOS, or Linux).
  • Run the installer and follow the on-screen instructions to complete the installation.
Launching VS Code:
  • Open Visual Studio Code after installation.
  • Familiarize yourself with the interface, including the explorer, search, source control, and extensions.

Creating a New HTML File

Open a New File:
  • Click on File > New File or use the shortcut Ctrl+N (Cmd+N on macOS).
  • Save the new file with the .html extension, for example, index.html.
Setting Up the Basic HTML Structure:
  • In the new HTML file, type the basic HTML 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 Website</title>

    </head>

    <body>

        <h1>Welcome to My Website</h1>

        <p>This is a paragraph.</p>

    </body>

    </html>

Understanding Basic HTML Tags

  • <!DOCTYPE html>: Declares the document type and version of HTML.
  • <html>: Root element of an HTML page.
  • <head>: Contains meta-information about the document.
  • <title>: Sets the webpage’s title, visible on the browser tab.
  • <meta charset=”UTF-8″>: Sets the character encoding.
  • <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>: Ensures the webpage is responsive.
  • <body>: Contains the content of the webpage.
  • <h1>: Defines a top-level heading.
  • <p>: Defines a paragraph.

Using VS Code Features to Enhance Coding

Syntax Highlighting:

VS Code highlights HTML tags and attributes in different colors to make the code more readable.

Code Autocompletion:
  • Start typing an HTML tag (e.g., <div>), and VS Code will suggest the full tag.
  • Press Enter to accept the suggestion.
Emmet Abbreviations:
  • Type ! and press Tab to quickly generate the basic HTML structure.

Use Emmet shortcuts to speed up coding (e.g., div.container>h1+p).

Previewing Your HTML File

Using Live Server Extension:
  • Install the Live Server extension from the VS Code marketplace.
  • Right-click on the index.html file and select Open with Live Server.
  • This will open your HTML file in the default web browser and automatically refresh the page when you save changes.
Manually Opening the File:
  • Save your HTML file.
  • Open the file location and double-click on the index.html file to open it in your default web browser.

Additional Resources

Articles:
Videos:

Conclusion

By following these steps, you will have successfully set up an IDE and created your first HTML webpage. Practice using the basic HTML tags and explore more features of your IDE to enhance your web development skills.

Optimized by Optimole
WhatsApp whatsapp
Messenger messenger
Instagram instagram
Call Us phone
chat