Professional Documents
Culture Documents
Block-Level and Inline Elements in HTML
Block-Level and Inline Elements in HTML
Elements in HTML
<!DOCTYPE html>
<html>
<body>
<h1>Hello</h1>
<p>This para will be displayed on new line because it
is a block level element</p>
</body>
</html>
When you run the above HTML code, you will get the
following output in the browser.
<a href="https://www.google.com">Hello</a>
<a href="https://www.google.com">Hello</a>
<!DOCTYPE html>
<html>
<body>
<span>Hello !!!</span>
<span>This text be displayed on same line because it
is a inline element</span>
<a href="https://www.google.com">Hello</a>
<a href="https://www.google.com">Hello</a>
</body>
</html>
When you run the above HTML code, you will get the
following output in the browser.