Style Sheets
  Home arrow Style Sheets arrow Page 3 - 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 - Creating the structural markup of the floating (X)HTML lists


    (Page 3 of 4 )

    In the previous section, I showed you all of the CSS styles required to build a couple of floating HTML lists, which can be easily included in any web document. However, I have to admit that this process is still incomplete, since it's necessary to create the structural markup of these lists.

    Thus, taking into account this important requisite, below I defined a basic web document which contains the markup of two regular HTML lists, properly floated to the left and right of the document by using the CSS styles that you learned earlier.

    Having explained that, here's how this primitive web document looks:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    <title>Basic example on building floating lists</title>

    </head>

    <body>

    <h1>Basic hands-on example on building floating lists</h1>

    <div>

    <ul>

    <li>This is the list item 1, floated to the left.</li>

    <li>This is the list item 2, floated to the left.</li>

    <li>This is the list item 3, floated to the left.</li>

    <li>This is the list item 4, floated to the left.</li>

    <li>This is the list item 5, floated to the left.</li>

    </ul>

    <ul>

    <li>This is the list item 1, floated to the right.</li>

    <li>This is the list item 2, floated to the right.</li>

    <li>This is the list item 3, floated to the right.</li>

    <li>This is the list item 4, floated to the right.</li>

    <li>This is the list item 5, floated to the right.</li>

    </ul>

    </div>

    </body>

    </html>


    So far, nothing unexpected, right? As you can see, the above web document includes two regular HTML lists that will be displayed on the browser following a regular order, that is the first one on top of the second one.

    Of course, the way that the previous HTML lists are rendered by the browser will be better understood if you look at the following screen shot, which shows the output generated by Mozilla Firefox:



    As you can see from the above image, the lists are displayed in a normal sequence. However, as I explained earlier, it's perfectly possible to use the CSS styles created in the previous section to turn these regular lists into two floating blocks, in this manner implementing floating lists.

    Obviously, in this specific case, the first HTML list would be floated to the left of the web document by assigning to it the "leftlist" CSS class that you saw previously, while the second one would be positioned to the right by using the other "rightlist" class.

    Nonetheless, all of the above explanations would be rather pointless if I don't show you a concrete example where you can see how these floating lists are finally constructed, by combining the structural markup of the prior web document and the CSS styles defined in the previous section.

    Sounds pretty logical, right? Thus, I think this is the appropriate moment to move on and read the last section of this tutorial, where I'll be completing the creation of floating HTML lists with CSS.

    What are you waiting for? Jump forward and read the next few lines! I'll be there, waiting for you.

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