Block Elements
A block element always starts on a new line, and the browsers automatically add some margin before and after the element.
block elements in HTML:
<address><article><aside><blockquote><canvas><dd><div><dl><dt><fieldset><figcaption>
<figure><footer><form><h1>-<h6><header><hr><li><main><nav><noscript><ol><p><pre>
<section><table><tfoot><ul><video>
Example
<!Doctype Html>
<html>
<head>
<title>Block Elements</title>
</head>
<body>
<p>This is first paragraph</p>
<p>This is second paragraph</p>
<p>This is third paragraph</p>
</body>
</html>
Output
This is first paragraph
This is second paragraph
This is third paragraph
Inline Elements
An inline element does not start from a new line.
Inline elements in HTML:
<a><abbr><acronym><b><bdo><big><br><button><cite><code><dfn><em><i><img>
<input><kbd><label><map><object><output><q><samp><script><select><small>
<span><strong><sub><sup><textarea><time><tt><var>
Example
<!Doctype Html>
<html>
<head>
<title>Inline Elements</title>
</head>
<body>
<strong>This is first paragraph.</strong>
<strong>This is second paragraph.</strong>
<strong>This is third paragraph.</strong>
</body>
</html>
Output
This is first paragraph.This is second paragraph.This is third paragraph.
Copyright ©2022 coderraj.com. All Rights Reserved.