Check out example codes for "div". It will help you in understanding the concepts better.

Code Example 1

<div style="background-color:lightblue">
  <h3>This is a heading</h3>
  <p>This is a paragraph.</p>

Code Example 2

  <!-- This is opening of a division tag-->

Code Example 3

The <div> tag is nothing more than a container unit that encapsulates other page elements and divides the HTML document into sections.
 The div can be used for reading purposes or to nest all the information inside the div then to style the div through css as a background card.

Code Example 4

.myDiv {
  border: 5px outset red;
  background-color: lightblue; 
  text-align: center;


<div class="myDiv">
  <h2>This is a heading 
  in a div element</h2>
  <p>This is some text in a div element.</p>



Code Example 5


Code Example 6

div {  display: block;}

Learn ReactJs, React Native from