HTML Elements and Attributes

1. Common Elements

  • Heading Tags: <h1> to <h6> define headings.
  • Paragraphs: <p> represents text content.
  • Lists: <ul> for unordered lists, <ol> for ordered lists.
  • Links: <a href=“URL”> creates hyperlinks.
  • Images: <img src=“image.jpg” alt=“Description”> embeds images.

2. Semantic Elements

  • <header>: Represents introductory content.
  • <section>: Defines a thematic grouping of content.
  • <article>: Represents self-contained content.
  • <aside>: Contains related content.
  • <footer>: Represents footer content.

3. Attributes in HTML

HTML attributes provide additional information about elements:

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

Common attributes include:

  • href (for links)
  • src (for images)
  • alt (for accessibility)
  • title (provides tooltip text)