In HTML, elements are broadly divided into two categories: block-level and inline. Block elements take up the full width and always start on a new line, while inline elements only take as much space as needed within a line.
Explanation: Div is a generic block container.
This is a <p> element
Explanation: Paragraph defines a block of text that starts on a new line.
Explanation: Headings are block-level elements that structure content.
Explanation: Unordered list defines bullet points.
Explanation: Ordered list defines numbered items.
"Coding is the new literacy."
Explanation: Blockquote is a block container for quotations.
Explanation: The hr tag defines a horizontal separator.
Row 1 Col 1 | Row 1 Col 2 |
Row 2 Col 1 | Row 2 Col 2 |
Explanation: Table creates a grid structure.
This is inside a span element.
Explanation: Span is an inline container with no new line.
Visit this link for more info.
Explanation: The a tag defines hyperlinks.
This is bold text.
Explanation: b makes text bold.
This is italic text.
Explanation: i makes text italic.
This is underlined text.
Explanation: u underlines text.
This is strong text.
Explanation: strong adds importance with bold emphasis.
This is emphasized text.
Explanation: em italicizes with emphasis.
E = mc2
Explanation: sup defines superscript text.
H2O is water.
Explanation: sub defines subscript text.
This is highlighted text.
Explanation: mark highlights text.
HTML stands for HTML.
Explanation: abbr defines an abbreviation.
Example code: console.log("Hello World")
Explanation: code represents inline programming text.
Block Elements | Inline Elements |
---|---|
<div> | <span> |
<p> | <a> |
<h1> | <b> |
<ul> | <i> |
<blockquote> | <abbr> |
<table> | <code> |
<hr> | <sup> |
<section> | <mark> |