HTML block element is any element that starts a new line or paragraph and uses the full width of the page or container. A block-level element can take up one line or multiple lines and has a line break before and after the element. It takes the available full width. It has top and bottom margin. The block element defined by <div> tag.
HTML inline element stays in the same line as the code that surrounds the text. It takes only the necessary width. It does not start with a new line. The Inline element defined by <span> tag within a paragraph.
<!DOCTYPE html>
<head>
<title>Blocks and Inline in HTML</title>
</head>
<body>
<p>Block element using Div tag</p>
<div style="color:green;">
<p>This is Paragraph</p>
</div>
<p> inline element using span tag</p>
<h1> Hi Welcome to <span style="color:red; font-size:25px;"> cstechiie </span> Website</h1>
</body>
</html>