Explain block level and text level elements with example
Answers
HTML (Hypertext Markup Language) elements historically were categorized as either "block-level" elements or "inline" elements. By default, a block-level element occupies the entire space of its parent element (container), thereby creating a "block." This article helps to explain what this means.
Browsers typically display the block-level element with a newline both before and after the element. You can visualize them as a stack of boxes.
These don't cause paragraph breaks. Text level elements that define character styles can generally be nested. They can contain other text level elements but not block level elements.
Font style elements
These all require start and end tags, e.g.
This has some <B>bold text</B>.
TT teletype or monospaced text
The quick red fox jumped over the lazy brown dog.
I italic text style
The quick red fox jumped over the lazy brown dog.
B bold text style
The quick red fox jumped over the lazy brown dog.
U underlined text style
The quick red fox jumped over the lazy brown dog.
HTML (Hypertext Markup Language) elements historically were categorized as either "block-level" elements or "inline" elements. By default, a block-level element occupies the entire space of its parent element (container), thereby creating a "block." This article helps to explain what this means.
Browsers typically display the block-level element with a newline both before and after the element. You can visualize them as a stack of boxes.