Style Sheets
  Home arrow Style Sheets arrow Page 4 - Introduction to CSS Positioning Properties...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

Introduction to CSS Positioning Properties Part 1
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 8
    2005-02-21

    Table of Contents:
  • Introduction to CSS Positioning Properties Part 1
  • Basic definitions
  • Inline and block boxes
  • CSS 2 Positioning Schemes
  • The "position" property
  • The "display" property

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introduction to CSS Positioning Properties Part 1 - CSS 2 Positioning Schemes


    (Page 4 of 6 )

    For the CSS2 specification, there are five styles of positioning for HTML elements. They are as follows:

    Static Positioning: Static positioned elements will be displayed flowing in the normal rendering sequence of the <body> content. It’s the default behavior for HTML elements. The "top" and "left" properties are not applicable, as we’ll see in a moment.

    Relative Positioning: Relatively positioned elements are positioned according to the normal flow and then moved. Elements that are rendered after a relatively-positioned element behave as if the relatively-positioned element was in its "normal flow" position, even if this means they occupy the same screen space.

    Absolute Positioning: Absolutely-positioned elements are not affected by normal flow. They’re positioned by specifying the "top," "left," "right" and "bottom" properties. The element remains located in the document at the specified coordinates. However, it will scroll along with the window or ViewPort.

    Fixed Positioning: Fixed-position elements work in the same way as absolutely-positioned elements, except that their position is relative to the ViewPort. As such, they don’t move if the page is scrolled -- they stay relative to the Viewport. Also, the "top," "left," "right" and "bottom" properties are applicable.

    Float Positioning: Elements positioned using the "float" property are positioned using the normal rendering flow and then moved left or right as far as they can go, according to the value assigned to the "float" property, whether is left or right. Elements that appear after them will move up to fill any gap left behind, but will flow around the box, so they won’t be displayed at the same screen position.

    Having defined the five styles to position elements, we should apply them using the "position" property in the following manner. We’ll see how it can be done in the next section.

    More Style Sheets Articles
    More By Alejandro Gervasio


       · Here's a quick guideline for commom CSS display properties. I think it's useful...
       · For the sake of accuracy, there's a /p> missing tag in the article.
     

    STYLE SHEETS ARTICLES

    - Creating Hybrid Web Page Layouts with Negati...
    - Creating Three-Column Web Page Layous with N...
    - Swapping Column Positions in Web Page Layout...
    - Creating Web Page Layouts with Negative Marg...
    - Creating Gradients for Individual Containers...
    - Creating Gradients for Web Page Headers with...
    - SEO Scrolling Frames Problem Solved
    - Building Cross-Browser Background Effects wi...
    - CSS: Pseudo
    - Using PNG Images to Build Background Effects
    - CSS: Continuing the Clarification of CSS Cla...
    - CSS: Top Secret Classification
    - CSS: Dimensions
    - CSS: Margins and Padding
    - CSS: Crossing the Border






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT