Style Sheets
  Home arrow Style Sheets arrow Page 2 - Building Floating Lists With CSS
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

Building Floating Lists With CSS
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-12-03

    Table of Contents:
  • Building Floating Lists With CSS
  • Building floating (X)HTML lists
  • Creating the structural markup of the floating (X)HTML lists
  • Completing the construction of floating lists

  • 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


    Building Floating Lists With CSS - Building floating (X)HTML lists


    (Page 2 of 4 )

    In accordance with the concepts I expressed in the introduction of this tutorial, one of the easiest ways to include a couple of floating lists into a given web document consists of using a simple "float" CSS property. We'll use this property to float the first list to the left of the document in question and place the second list to the right.

    It's quite probable that at this point you'll be wondering how the previous process can be put into practice. Below I coded two basic CSS classes. They are responsible for floating the two aforementioned HTML lists to the left and right of a given web document.

    The corresponding CSS code looks like this:


    body{

    padding: 0;

    margin: 0;

    background: #fff;

    }

    h1{

    font: bold 18pt Arial, Helvetica, sans-serif;

    color: #000;

    }

    #listcontainer{

    width: 70%;

    }

    ul.leftlist{

    float: left;

    }

    ul.rightlist{

    float: right;

    }


    As you can see, aside from styling the respective "body" and "h1" selectors of the pertinent web page, I defined two basic CSS classes -- called "leftlist" and "rightlist" -- which are tasked with floating the respective HTML lists to the left and the right sides of the web page in question via the "float" CSS property.

    Also, I created an additional "listcontainer" selector, which will come in handy for wrapping the pertinent lists into a single containing DIV.

    Well, so far everything looks good, right? At this stage, hopefully you grasped the logic that stands behind building two simple floating lists by means of a few CSS styles, since the entire procedure is reduced to positioning the lists in question via the "float" property. Period.

    So, what's the next step? Now that you've seen how the previous CSS styles look, it's time to incorporate the corresponding markup of the floating lists, so you can see more clearly how they can be floated to the left and right sides of a web document.

    To learn the complete details of this process, please click on the link that appears below and keep reading.

    More Style Sheets Articles
    More By Alejandro Gervasio


       · Floating HTML lists are commonly used on many web sites today. This first chapter of...
     

    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 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek