Introduction: In HTML, elements are broadly divided into two categories: block-level and inline. Block elements take up the full width, while inline elements only take as much space as needed.
Block ElementsThis is a paragraph
Explanation: The <p> tag defines a block of text that always starts on a new line. Example:"Coding is the new literacy."Explanation: Blockquote is a block container for quotations.
console.log("Hello World")
Explanation: Code tag represents programming text.
Block Elements | Inline Elements |
---|---|
<div> | <span> |
<p> | <a> |
<h1> | <b> |
<ul> | <i> |
<blockquote> | <abbr> |
<table> | <code> |
<hr> | <sup> |
<section> | <mark> |