2-core-html-structure-elements

Keith Blackwood

HTML Elements

  • HTML elements are the foundation of all content on websites.
  • Elements are wrapped in tags, which use angle brackets (<>).
  • Many elements have closing tags (e.g., </>), allowing content to be added between the tags to be displayed.
  • The most common elements are headings, paragraphs, and divs.

Headings and paragraphs

  • Heading and paragraph elements are designed to contain text.
  • Example structure:

    Hello World!

  • Wrapping text in element tags improves accessibility by helping screen readers understand the layout.
  • It also simplifies styling.

Div elements

  • Divs are used to contain content on a website.
  • Think of divs as boxes that hold other content, such as headings and text.
  • Positioning the div also positions its content, making layout management easier.
  • Divs are particularly useful for grouping and positioning nested elements.
  • Adding elements inside divs is called nesting.

Putting it all Together

  • Nesting divs