Skip to content

2.3 HTML Working With Text

Paragraphs

  • A paragraph element <p> will add a newline after the text in the paragraph element

Headings

  • 6 levels from <h1> to <h6>

Strong Element

  • <strong> makes text bold

  • Semantically marks text as important

    • Affects tools like screen readers (changes the tone of the audio screen reader)
  • Can be used independently or in conjunction with other text elements

  • To create bold text without giving it important meaning, see CSS lessons

Em Element

  • <em>

  • Makes text italic

  • Semantically places emphasis on the text, again affect screen readers

  • Can be used independently or in conjunction with other text elements

Nesting & Indentation

  • Element within elements are indented (This is nesting)

    • When we nest, we create a parent/child relationship between the elements
  • Elements at the same level of nesting are considered to be siblings.

  • Indentation makes nesting clear and readable

  • Indent any child elements by two spaces

HTML Comments

  • Not visible to the browser; notes for the devs

  • Start with <!--

  • end with -->

  • <!-- I am an html comment -->