Sample Article
This is content inside an article element.
In HTML, elements are broadly divided into two categories: block-level and inline. Block elements take up the full width and start on a new line, while inline elements only use as much width as needed and flow with text.
Block Elements | Inline Elements | Comparison
This is a paragraph inside a block element.
Explanation: Paragraphs always start on a new line.
Explanation: Headings define different levels of section titles.
Explanation: Div is a generic block container.
Explanation: Unordered lists display items with bullets.
Explanation: Ordered lists display items with numbers.
"Coding is the new literacy."
Explanation: Blockquote is used for long quotations.
Above this line
Below this line
Explanation: HR draws a thematic break.
Row 1, Col 1 | Row 1, Col 2 |
Row 2, Col 1 | Row 2, Col 2 |
Explanation: Table is used to display data in rows and columns.
Explanation: Section groups related content together.
This is content inside an article element.
Explanation: Article is a block for independent content.
This sentence has a red word inside.
Explanation: Span is an inline container.
Visit Example website.
Explanation: Anchor creates hyperlinks.
This is bold text and this is important text.
Explanation: Both make text bold; strong has semantic meaning.
This is italic text and this is emphasized text.
Explanation: Both italicize; em adds importance.
This is underlined text.
Explanation: U adds underline inline.
E = mc2 and H2O.
Explanation: Sup writes above line, sub writes below.
This is a highlighted word.
Explanation: Mark highlights text inline.
HTML is the standard for web pages.
Explanation: Abbr shows abbreviations with tooltips.
Inline code example: console.log("Hello")
Explanation: Code tag is for inline code snippets.
This is smaller text.
Explanation: Small renders text in a smaller size.
Block Elements | Inline Elements |
---|---|
<div> | <span> |
<p> | <a> |
<h1> <h6> | <b> |
<ul> | <i> |
<blockquote> | <abbr> |
<table> | <code> |
<hr> | <sup> |
<section> | <mark> |