HTML divisions : div « Tags « HTML / CSS






HTML divisions

      
<!DOCTYPE html> 
<html> 
<head> 
<title>Example 2.18</title> 
<style type="text/css"> 
body { padding: 0 36px; } 
h1 { font-family: sans-serif; padding-top: 60px; } 
#header { margin-bottom: 36px; } 
#header img { float: left; } 
#header a { text-decoration: none; } 
#top-menu, 
#bottom-menu { margin-left: -36px; }
#top-menu li { float: left; 
padding: 5px; 
border: 1px solid; 
list-style: none; 
margin-right: 5px; } 
#bottom-menu li { float: left; 
padding: 0 10px; 
border-right: 1px solid; 
list-style: none; } 
div.navigation { clear: left; font-family: arial,sans-serif;} 
address { clear: left; text-align: right; padding-top: 36px;} 
</style> 
</head> 
<body> 
<div id="header"> <!-- Logo and main menu --> 
<div id="logo"> 
<img src="../images/logo.gif" alt="Logocorp Inc."/> 
<h1>Welcome to Logocorp</h1> 
</div> 
<div class="navigation"> 
<ul id="top-menu"> 
<li><a href="home.html">Home</a></li> 
<li><a href="about.html">About</a></li> 
<li><a href="what.html">...</a></li> 
</ul> 
</div> 
</div> 
<hr/> 
<div id="content"> <!-- content division --> 
<h2>News</h2> 
<p>We are doing good things... </p> 
<p>Logos are everywhere... </p> 
</div> 
<hr /> 
<div id="footer"> <!-- page footer --> 
<div class="navigation"> 
<ul id="bottom-menu"> 
<li><a href="home.html">Home</a></li> 
<li><a href="about.html">About</a></li> 
<li><a href="what.html">...</a></li> 
</ul> 
</div> 
<address>copyright &copy; 2010, , Inc.</address> 
</div> 
</body> 
<html> 

   
    
    
    
    
    
  








Related examples in the same category

1.'div' Example
2.DIV color: white;
3.div::before content: "I said, \"Hello, world!\"";
4.div::before color: white;
5.div with id selector
6.Using div as img tag
7.This div stretches across the whole window.
8.div content: "This string is placed inside of all div elements.";
9.Using div to layout table elements
10.Div element
11.Div color: #676767;
12.Div based multi-column
13.Div color: red;
14.Div color: #FEF9ED;
15.DIV overflow: hidden;
16.DIV as container
17.Using two Nested DIV to do the layout
18.DIV color: #9D9C6A;
19.DIV color: #505050;
20.Nested div box
21.Default layout for div tags
22.The dialogue div element is aligned vertically and horizontally, no matter what the size of the browser window.
23.div for header and body
24.Grouping Elements Using the div Element
25.Two boxes with div tags
26.Division tag
27.div with id style
28.div with class name
29.div.className (tag.className)
30.div in a div with class name
31.Use DIV as wrapper
32.Click to show or hide DIV section
33.Click to show and hide DIV content (IE only)
34.Block divider
35.'nowrap' is similar to the 'pre' element