Style Sheets
  Home arrow Style Sheets arrow Page 4 - Building Cross-Browser Floating Lists with...
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 Cross-Browser Floating Lists with CSS
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2008-12-10

    Table of Contents:
  • Building Cross-Browser Floating Lists with CSS
  • A quick review
  • Styling list bullets
  • Displaying floating HTML lists in a cross-browser fashion

  • 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 Cross-Browser Floating Lists with CSS - Displaying floating HTML lists in a cross-browser fashion


    (Page 4 of 4 )

    In the section that you just read, I improved the visual appearance of the floating lists by styling their bullets. Sadly, this process in its current state is rather pointless, since these elements still won’t be displayed by Internet Explorer.

    To solve this specific issue, below I coded a brand new (X)HTML file that changes the positions in which list bullets are shown, by assigning to them a value of “inside.” Here’s the signature of the file in question:


    <!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 (works in most browsers)</title>

    <style type="text/css">

    body{

    padding: 0;

    margin: 0;

    background: #fff;

    }

    h1{

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

    color: #000;

    }

    #listcontainer{

    width: 70%;

    }

    ul.leftlist{

    float: left;

    list-style-position: inside;

    list-style-type: square;

    }

    ul.rightlist{

    float: right;

    list-style-position: inside;

    list-style-type: square;

    }

    </style>

    </head>

    <body>

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

    <div id="listcontainer">

    <ul class="leftlist">

    <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 class="rightlist">

    <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>


    As you can see, the only relevant modification that I introduced into the above (X)HTML file concerns the positions of the bullets corresponding to each floated list. In this concrete case, the bullets will be displayed “inside,” instead of outside the respective lists, but the major advantage in changing this CSS property is that now IE will display the pertinent bullets in the correct way.

    The image below shows how IE now renders the floated lists:



    Don’t you feel a bit happier? You should, because at this moment you’ve learned how to build floating HTML lists that will be displayed consistently by most modern browsers. As always, feel free to use all of the code samples included in this tutorial to acquire more practice in creating these kinds of lists.

    Final thoughts


    That’s all for the moment. In this second chapter of the series, I taught you how to build a couple of floating HTML lists that will be displayed consistently by most modern browsers. As you learned previously, developing this cross-browser approach for showing the pertinent lists only required us to play a bit with bullet positions, and nothing else.

    In the upcoming article, I’ll be teaching you more useful things regarding the construction of floating lists with CSS. You'll learn how to adjust their padding and margin values, and the indentation of each list item.

    Now that you’ve been warned about the topics that will be discussed in the next part, you won’t want to miss it!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This second chapter of the series shows how to build easily floating HTML lists that...
     

    STYLE SHEETS ARTICLES

    - 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...
    - Pulling Web Page Elements with the Blueprint...
    - Pushing Web Page Columns with the Blueprint ...
    - Controlling Column Padding with the Blueprin...
    - Prepending Classes in the Blueprint CSS Fram...
    - Appending Grid Units with the Blueprint CSS ...
    - Changing Grid Units in the Blueprint CSS Fra...
    - The Blueprint CSS Framework
    - Building a Liquid Design with Evened Margins...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT