โฎ Previous

Basic HTML Page Creation

  • This lesson teaches how to create a basic HTML page from scratch, including file creation, HTML structure, and viewing the page in a browser.

  • ๐Ÿง  What Does โ€œBasic Page Creationโ€ Mean?

    Creating a basic HTML webpage means combining everything youโ€™ve learned so far into one complete file.

    It includes:

     โœ… HTML structure
    โœ… Tags & elements
    โœ… Attributes
    โœ… Best practices

    ๐Ÿงฉ Think of it as assembling all lego blocks into one house ๐Ÿ 
  • ๐Ÿงฑ Basic HTML Page Structure

    Every HTML page follows this standard structure:

Basic HTML Page

This is a simple HTML webpage that displays a heading, a paragraph, an image, and a link, demonstrating the basic structure of an HTML document.

<!DOCTYPE html>
<html>
  <head>
    <title>My Simple Webpage</title>
  </head>
  <body>

    <h1>Hello Everyone!</h1>

    <p>This is my first webpage using HTML.</p>

    <img src="image.jpg" alt="Sample Image">

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

  </body>
</html>
Lesson image
  • ๐Ÿ” Explanation

    โœ… <!DOCTYPE html>

    <!DOCTYPE html>

    ๐Ÿ“Œ Tells the browser:

    โ€œThis page is written in HTML5โ€

     โœ… Always written at the top
    โœ… No closing tag

    โœ… <html> Tag

    <html>

     ๐Ÿ“Œ The root element of the webpage
    ๐Ÿ“Œ Wraps everything

    โœ… <head> Section

    <head>

      <title> My Simple Webpage </title>

    </head>

    ๐Ÿง  Contains page information (not visible on page)

    โœ… <title> โ†’ Text shown on the browser tab

    โœ… <body> Section

    <body>

    ๐Ÿ“Œ Contains everything visible on the webpage:

     โœ… Text
    โœ… Images
    โœ… Links
    โœ… Headings

    โœ… Heading Element

    <h1> Hello Everyone! </h1>

     ๐Ÿ“Œ Main title of the webpage
    ๐Ÿ“Œ Most important heading

    โœ… Paragraph Element

    <p>This is my first webpage using HTML</p>

    ๐Ÿ“Œ Used for normal text content

    โœ… Image Element

    <img src="image.jpg" alt="Sample Image">

     ๐Ÿ“Œ Displays an image
    ๐Ÿ“Œ src โ†’ image location
    ๐Ÿ“Œ alt โ†’ image description (SEO & accessibility โœ…) 

    โœ… Link (Anchor) Element

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

     ๐Ÿ“Œ Creates a clickable link
    ๐Ÿ“Œ href โ†’ destination URL

  • ๐ŸŒˆ What You Have Used in This Page

     โœ… Structure โ†’ html, head, body
    โœ… Elements โ†’ h1, p, img, a
    โœ… Attributes โ†’ src, alt, href
    โœ… Best practices โ†’ Proper structure, lowercase tags 

    ๐Ÿง  Best Practices to Remember

     โœ… Always use <!DOCTYPE html>
    โœ… Use lowercase tags
    โœ… Indent code properly
    โœ… Always add alt for images
    โœ… One <h1> per page (recommended)

    โœจ This is the first milestone in web development
    โœจ Every big website starts with a simple HTML page like this

    ๐Ÿš€ HTML mastered ? CSS & JavaScript become easy!
  • ๐Ÿง  What Are HTML Comments?

    HTML comments are notes written inside HTML code that are:

     โœ… Visible to developers
    โŒ Invisible to users (browser does not display them)

    ๐Ÿงฑ Syntax of HTML Comments

    <!-- This is a comment -->

     โœ… Starts with <!--
    โœ… Ends with -->
    โœ… Content inside is ignored by the browser

    โœ… Example

    <!-- This is a heading -->

    <h1>Welcome to My Website</h1>

    ๐Ÿ“Œ The browser will show:

    Welcome to My Website

    โœ… The comment is only for developers

    ๐Ÿ›‘ Comments Are Not Displayed

    <p>Hello World</p>

    <!-- <p>This paragraph is hidden</p> -->

     ๐Ÿ“Œ Output:
    โœ… Only Hello World is shown
    โŒ Second paragraph is hidden because it's commented

    ๐Ÿงฉ Multi-Line Comments

    HTML comments can span multiple lines:

    <!--

    This is a multi-line comment

    Used to explain large code blocks

    Very helpful for beginners

    -->

โฎ Previous