div

Form

<div> ... </div>

Attributes

attribute default description
id none specifies the unique ID
class none specifies the style sheet class
style none specifies the style sheet
align left specifies the alignment

Support

HTML 3.2, HTML 4.01 [STF], XHTML 1.0 [STF], XHTML 1.1, XHTML Basic
Microsoft (MSDN)
[IE3 or later][Firefox 1 or later][Safari 1 or later][Opera 6 or later][Netscape 6 or later]

Explanation

The div tag indicates the alignment of a division block text and the block-level section to apply CSS.

Related Tags

span

Sample Code [Output]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=shift_jis">
<title>Sample</title>
<style type="text/css"><!--
div {
border:1px solid black;
}
--></style>
</head>
<body>
<h1>Sample</h1>
<div>
It's sample.
</div>
</body>
</html>