'div' Example : div « HTML Tag Reference « HTML CSS Reference






'div' Example

    
<html>
<head>
<title>div element example</title>
</head>
<body>
   <div id="Layer1" style="position:absolute; 
                           visibility:visible; 
                           width:300px; 
                           height:294px; 
                           background-color:#FFFFCC; 
                           layer-backgroundcolor:#FFFFCC; 
                           border:1px none #000000; 
                           z-index:1"> 
     <p><img src="yourImage.jpg" alt="" width="300" height="225"></p>
     <p align="center">This div element contains an image plus a center aligned text.</p>
   </div>
   <div id="Layer2" style="position:absolute; 
                           visibility:visible; 
                           width:315px; 
                           height:174px; 
                           background-color:#EEEEEE; 
                           layer-background-color:#CCFFCC; 
                           border:1px none #000000; 
                           z-index:2"> 
     <p>Text.</p>
   </div>
</body>
</html>
           
      
      








Related examples in the same category

1.'div' Syntax and Note
2.'div' HTML Attributes
3.'div' Event Handlers
4.'div' CSS Attributes and JavaScript Style Properties
5.'div' Microsoft Behaviors
6.'div' Microsoft Filters
7.'div' JavaScript Properties
8.'div' JavaScript Methods
9.'div' JavaScript Collections
10.'div' JavaScript Objects