HTML: The Structure of a Webpage

HTML is like the skeleton of a webpage. It provides the basic structure, which means how everything is arranged on the page.

Key Concepts:

  1. Elements and Tags:
    • An HTML element usually consists of a start tag, content, and an end tag. Example: <p>This is a paragraph.</p>
    • The element <p> defines a paragraph, and the text inside is the content.
  2. Attributes:
    • HTML tags can have attributes which give extra information about the element.
    • Example: The src attribute in an image tag tells the browser where to find the image. <img src="image.jpg" alt="Description of the image">
      • src="image.jpg" specifies the image file.
      • alt="Description of the image" provides text if the image doesn’t load.
  3. Nesting:
    • HTML elements can be nested inside other elements to build complex structures. Example: <div> <h1>This is a heading</h1> <p>This is a paragraph inside a div container.</p> </div>