Learnwizy Technologies Logo

Learnwizy Technologies

Class 1: Introduction to the Web & HTML Fundamentals


Overview of Web Development

Welcome to the first class of your Full Stack Web Development course! In this session, we'll lay the groundwork for understanding how the web works and dive into HTML, the fundamental language for creating web content.

At its core, web development is about building applications that run over the internet. This involves various technologies and concepts, but a central idea is the client-server model.

The Client-Server Model

Client-Server Model Diagram

Imagine you're at a restaurant. You (the client) ask the waiter to bring you food (a request). The waiter then goes to the kitchen (the server), retrieves your order, and brings it back to you (a response).

In web development:

How the Web Works

How the Web Works Diagram
  1. Type URL: When you enter a web address (e.g., www.google.com) into your browser, you are telling your browser where to find the website.
  2. DNS Lookup: Your computer needs to translate that human-readable URL into an IP address (e.g., 216.58.215.78), which is like a phone number for the server. This is done by the DNS (Domain Name System) Server.
  3. HTTP Request: Your browser then sends an HTTP (HyperText Transfer Protocol) or HTTPS request to the server at that IP address, asking for the webpage. HTTPS is the secure version of HTTP, which encrypts the communication between the browser and the website protecting sensitive information from eavesdropping and tampering.
  4. Server Process: On receiving the request, the server processes it and prepares the requested webpage files (HTML, CSS, JavaScript, images, etc.).
  5. HTTP Response: The server sends an HTTP response back to your browser, containing all the files needed to display the webpage.
  6. Browser Renders Page: Your browser receives these files and uses them to render the webpage on your screen, combining the HTML structure, CSS styling, and JavaScript interactivity.

HTML Fundamentals

What is HTML?

HTML stands for HyperText Markup Language. It is the standard markup language for documents designed to be displayed in a web browser. HTML describes the structure of web pages using a series of elements.

Think of HTML as the skeleton or blueprint of your webpage. It tells the browser what content is there (headings, paragraphs, images, links) but not how it should look (that's CSS's job).

HTML Tags and Elements

An HTML document is made up of elements. An HTML element is defined by a start tag, some content, and an end tag.

<tagname>Content goes here...</tagname>

HTML Attributes

HTML attributes provide additional information about HTML elements. They are always specified in the start tag and usually come in name/value pairs like: name="value".

<a href="https://www.example.com" title="Visit Example Website">Example</a>

Basic Document Structure

Every HTML document follows a fundamental structure to be valid and properly understood by browsers.

<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>My First Webpage</title>
    </head>
    <body>
        <!-- Content goes here -->
    </body>
    </html>

Let's break down these essential tags:


Common HTML Elements

Headings

Headings are used to define titles and subtitles within your content. HTML provides six levels of headings, from <h1> (the most important) to <h6> (the least important).

<h1>This is a Main Heading</h1>
<h2>This is a Sub-heading</h2>
<h3>This is a Sub-sub-heading</h3>
<h4>A smaller heading</h4>
<h5>Even smaller heading</h5>
<h6>The smallest heading</h6>

Paragraphs

Paragraphs are used to display blocks of text.

<p>This is the first paragraph of text on my webpage.</p>
<p>Each paragraph will appear on its own line, with some space above and below.</p>

Text Formatting

HTML provides several elements for formatting text, giving it semantic meaning and affecting its visual presentation (though styling is primarily done with CSS).

Lists

HTML supports different types of lists to organize items.

Links (Anchors)

The anchor element, represented by the <a> tag, is fundamental for creating hyperlinks, which allow users to navigate between different web pages or to specific sections within the same page.

Hyperlinks are what make the World Wide Web a "web" of interconnected documents, enabling seamless navigation and information discovery.


Semantic HTML5 Elements

With HTML5, new elements were introduced to provide more semantic meaning to the structure of a webpage. "Semantic" means that the tag itself describes the type of content it contains, which helps both developers and browsers/assistive technologies understand the document's structure better.

While you could use <div> elements for everything, semantic tags offer significant advantages for:

Here are some key semantic HTML5 elements:

Understanding and using these semantic elements correctly is a hallmark of writing clean, modern, and accessible HTML.


Basic HTML Best Practices

Indentation and Readability

Consistent indentation (e.g., 2 or 4 spaces) makes your HTML code much easier to read and understand. It visually represents the nesting of elements, making the structure of your document clear at a glance. Proper indentation improves maintainability and collaboration.

Comments

Comments in HTML allow you to add notes or explanations within your code that are not displayed by the browser. They are useful for:

<!-- This is a single-line comment -->

<!--
  This is a multi-line comment.
  It can span across several lines.
-->

<p>This is visible content.<!-- This part is commented out and not visible. --></p>

HTML Validation

HTML validation refers to checking your HTML code against the official W3C HTML standards. While modern browsers are very forgiving of errors, validating your HTML ensures that your code is syntactically correct and well-formed. This can help prevent unexpected rendering issues across different browsers and devices, improve accessibility, and make it easier for other tools and scripts to process your HTML. It's a good practice to validate your HTML, especially for public-facing websites.