Skip to main content

Block and Inline

Block and Inline | HTML: Block elements are occupies entire width of web page and they are begins with new line but Inline elements are occupies required width and they are not begin with new line.

Here is the blockandinline.html:

  1. <!DOCTYPE html>
  2. <html lang="en" dir="ltr">
  3.   <head>
  4.     <title>Block and Inline Elements in Html</title>
  5.   </head>
  6.   <body style="background-color:#FFFFFF;font-size:30px;">
  7.     <h3>Here is the Details of Block and Inline Elements</h3>
  8.     <!-- Block Element -->
  9.    <div style="color:green;">Here is the examples :
  10.      h1 to h6, p, table, tr,<p>hello</p> th, td, ol, ul and li</div>
  11.    <!-- Inline Elements -->
  12.    <p>Here is the examples : <span style="color:orange;">a, img,
  13.      b, i, sub, sup,
  14.      strong, abbr, acronym, q, and map </span></p>
  15.   </body>
  16. </html>

Web view of Html:



Here is the Video: