DEV Community

Cover image for HTML - HTML text fundamentals
Lachelle Zhang
Lachelle Zhang

Posted on • Updated on

HTML - HTML text fundamentals

HTML text fundamentals

Structure in text

One of HTML's main jobs is to give text structure so that a browser can display an HTML document the way its developer intends. We can add structure to a page of text by adding headings and paragraphs, emphasizing words, creating lists, and more.

  • <h1> - <h6> - headings
  • <p> - paragraph
  • <ul> <ol> <li> - unorderd list, ordered list, list
  • <em> - emphasis
  • <i> <b> <u> - italic, bold, underline

What is semantics HTML?

The HTML semantics refers to the tags that provide meaning to an HTML page rather than just presentation. It makes HTML more comprehensible by better defining the different sections and layout of web pages.

What are semantic elements?

A semantic element clearly describes its meaning to both the browser and the developer. Examples of non-semantic elements: <div> and <span> - Tells nothing about its content. Examples of semantic elements: <form>, <table>, and <article> - Clearly defines its content.

Why do we need semantics?

  • It makes web pages more informative and adaptable.
  • It allows browsers and search engines to better interpret content.

Top comments (0)