<

HTML <div> Tag

The <div> tag defines a division or a section in an HTML document.The <div> element is often used as a container for other HTML elements to style them with CSS or to perform certain tasks with JavaScript.

Attributes



Attribute Value Description
align left
right
center
justify
Not supported in HTML5.
Specifies the alignment of the content inside a <div> element


Example



<!DOCTYPE html>
<html>
<body>
<div style="background-color:green">
  <h3>This is a heading in a div.</h3>
  <p>This is some text in a div.</p>
</div>

</body>
</html>

















© copyright 2017-2022 Completedone pvt ltd.