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:
- 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.
- Attributes:
- HTML tags can have attributes which give extra information about the element.
- Example: The
srcattribute 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.
- 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>
- HTML elements can be nested inside other elements to build complex structures. Example: