CMW: Using divs

Creating and Maintaining a Website: Using divs

Open html2-code > chapter2 > web_site_files > 06_adding_structure_with_divs > index.html.

Save this file to your root folder as index.html. You must also save the image divers-circle.jpg to your root folder. Preview!

Here’s an example of what the tags look like:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>Example of the div element</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″/>
</head>

<body>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<p>This is yet another paragraph.</p>
<p>And just one more paragraph.</p>

<div>This is a div.</div>
<div>The content of each div appears on a new line.</div>
<div>But unlike paragraphs, there is no additional padding.</div>
<div>A div is a generic block-level container.</div>
</body>

</html>