Total members 11895 |It is currently Tue Dec 03, 2024 5:58 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





static vs fixed div position , static position is the default and it is not affect by top,left,right,bottom properties ,you can change position to fixed in coming example to see the difference.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
    <
meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <
title>static postion of div</title>
    <
style type="text/css" media="Screen">
* .
mainDiv {
  
 
  
background#FFCC33;
}

*.
divstatic {
  
position: static;
  
background#EE4C77;
  
padding-left50px;
  
top:30px;
  
right:5px;
  
margin-top:30px;
  
margin-right50px;
  
margin-bottom50px;
 
}
</
style>
</
head>
<
body>
<
div class="mainDiv">Positioned div
  
<div class="mainDiv">Non-positioned div 
    
<div class="divstatic" >static postioned div</div

  </
div
</
div
</
body>
</
html>

 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : static vs fixed div position
 difference between a static and a non-static inner class     -  
 simple example for fixed image     -  
 Fixed Space Using imageTTFbbox()     -  
 (3.0.4) Skymiles Setting Fixed WIDTH     -  
 Fixed Quantity Inventory model Simulator (C++)     -  
 What is a static method     -  
 Static Import     -  
 Static Methods and Variables     -  
 Class static properties     -  
 static variable defined in function     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com