Home >> HTML 5 >> What is Block and Inline Elements in HTML 5

What is Block and Inline Elements in HTML 5

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.

Post Your Comment

Next Questions
What is HTML class Attribute
What is HTML id Attribute
What is HTML Iframes
What is HTML JavaScript
What is HTML File Paths
What is HTML Head Element
What is HTML Layout
What is HTML Responsive Website Design
What is HTML Forms
What is HTML Form Attributes
What is HTML Form Elements
What is HTML Input Types
What is HTML Input Attributes
What is HTML Input form attributes
What is HTML SVG Graphics
What is HTML Multimedia
What is HTML Video
What is HTML Audio
How to Embed YouTube Video
What is HTML Predefined Tags
What is HTML Predefined Attributes
Comment Tag
DOCTYPE Tag
a Tag
abbr Tag

Copyright ©2022 coderraj.com. All Rights Reserved.