Style Sheets
  Home arrow Style Sheets arrow Page 3 - 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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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 - Inline and block boxes


    (Page 3 of 6 )

    As you probably know, several types of boxes are available in HTML. However, for the scope of this article, we reference only two types of boxes: inline boxes and block boxes.

    Inline boxes: Inline elements are visually rendered as elements positioned next to each other. They’re commonly used to wrap small chunks of content given that a specific style is applied. The most common tag to be used for inline positioning is the <span> element, since it gives structure and context to any inline content in a Web document. For example:

    While <span class="bolded">this text is highlighted</span>, the rest is normal.

    Only using the <span> styled element, we’ve highlighted a chunk of text, within a sentence. The visual output for this example is the following:

    As we can see, the highlighted text is visually rendered next to the normal text, behaving as an "inline element." There are other common HTML elements that default to behaving as "inline," such as <img> or <a>. However, these default behaviors may be changed using the CSS "display" property, as we’ll shortly see.

    Let’s define the concept of block boxes.

    Block boxes: Block elements are the type of boxes generated by elements such as <div>, <p>, or headers <h1>…<h6>. When they’re displayed in documents, the next element within the document structure will be positioned below of it, and not next to it. A clear example would be:

    <h3>This is a block box</h3>

    <h4>This is block box</h4>

    <div>This is a block box</div>

    The visual output would be as follows:

    Inline and block boxes are simple but key concepts to start defining the layout and position of page elements, since they’re pretty easy to grasp. Once we’ve roughly described inline and block elements, we need to be able to position each element in our Web documents. CSS2 provides plenty of room for doing that. So, let’s dive into the CSS2 position schemes, in order to find out more about them.

    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

    - Image Replacement CSS Techniques
    - Using BlueTrip`s Success, Notice and Error C...
    - More Uses for the Thin and Caps CSS Classes ...
    - Styling Definition Lists with the BlueTrip C...
    - Styling Unordered and Ordered HTML Lists wit...
    - Using the BlueTrip CSS Framework`s Thin and ...
    - Adding Borders to Web Page Columns with Blue...
    - Introducing the BlueTrip CSS Framework
    - Using a Background Grid to Assist Web Page L...
    - Extending the Rule Of Thirds for Web Page La...
    - A Two-Column Web Page Layout Based on the Ru...
    - Using the Rule Of Thirds for Web Page Layout
    - Swapping Columns Using the Divine Ratio for ...
    - Using the Golden Ratio in Liquid Web Page De...
    - Fundamental Design Principles for Web Page L...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek