[Block Elements] [Inline Elements] [Comparison]
In HTML, elements are mainly divided into block-level and inline. Block elements take up the full width available and start on a new line, while inline elements stay within a line of text.
Div is used to group other elements together.
This is a <p> paragraph.
Paragraphs are block elements that hold text.
Headings (<h1>–<h6>) define titles and sections in content.
<ul> creates bullet lists.
<ol> creates numbered lists.
“This is a blockquote – used for quotations.”
<blockquote> is for quoted text.
<hr> creates a horizontal line to separate content.
| Row 1, Col 1 | Row 1, Col 2 |
| Row 2, Col 1 | Row 2, Col 2 |
<table> organizes data in rows and columns.
Here is a span inside text.
<span> is used to mark part of text inline.
You can visit this link.
<a> creates hyperlinks.
This text is bold and this is important.
<b> and <strong> make text bold, but <strong> adds importance.
This is italic and this is emphasized.
<i> and <em> make text slanted, but <em> adds meaning.
This is underlined.
<u> underlines text.
Math like H2O and X2.
<sub> is subscript, <sup> is superscript.
This is highlighted text.
<mark> highlights text.
WHO is an abbreviation.
<abbr> shows abbreviations with tooltips.
Use print(\"Hello\") to show code.
<code> is for inline code.
| Inline Elements | Block Elements |
|---|---|
| <span> | <div> |
| <a> | <p> |
| <b> | <h1> |
| <i> | <ul> |
| <u> | <ol> |
| <strong> | <blockquote> |
| <em> | <hr> |
| <code> | <table> |