Style Sheets
  Home arrow Style Sheets arrow Page 2 - Combining Floating Lists with Other Web Pa...
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

Combining Floating Lists with Other Web Page Elements
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-12-23

    Table of Contents:
  • Combining Floating Lists with Other Web Page Elements
  • Using a floating HTML list with other web page elements
  • Polishing the appearance of the sample (X)HTML file
  • Seeing the recently styled HTML 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


    Combining Floating Lists with Other Web Page Elements - Using a floating HTML list with other web page elements


    (Page 2 of 4 )

    In accordance with the concepts that I deployed in the introduction, my humble plan consists of demonstrating how a couple of HTML lists can be utilized in conjunction with other web page elements. First I’m going to create a sample web page that will contain some trivial paragraphs, and then a pair of floating lists will be embedded into the page in question.

    Now that I have explained how this example is going to function, please focus your attention on the following (X)HTML file. It shows how construct a basic web document that displays the paragraphs along with the floating lists. Here it is:


    <!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 using floating lists in conjunction with paragraphs</title>

    <style type="text/css">

    body{

    padding: 0;

    margin: 0;

    background: #fff;

    }

    h1{

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

    color: #000;

    }

    #container{

    width: 1000px;

    }

    ul.leftlist{

    float: left;

    width: 350px;

    position: relative;

    padding: 10px 20px;

    margin: 0 0 15px 0;

    list-style-position: inside;

    list-style-type: disc;

    background: #eee;

    border: 1px solid #999;

    }

    ul.rightlist{

    float: right;

    width: 350px;

    position: relative;

    padding: 10px 20px;

    margin: 0 0 15px 0;

    list-style-position: inside;

    list-style-type: disc;

    background: #eee;

    border: 1px solid #999;

    }

    li{

    font: normal 10pt Arial, Helvetica, sans-serif;

    color: #000;

    margin: 5px 0 5px 0;

    }

    p{

    clear: both;

    font: normal 10pt Arial, Helvetica, sans-serif;

    color: #000;

    margin: 0 0 15px 0;

    }

    </style>

    </head>

    <body>

    <h1>Basic example on using floating lists with paragraphs</h1>

    <div id="container">

    <p>This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph.</p>

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

    <p>This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph. This is the content of a simple paragraph.</p>

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


    See how simple it is to combine some floating HTML lists with a few paragraphs within the same web document? I bet you do! In this case, I decided to code four different lists, so you can see more clearly how these elements can be used in conjunction with others. This should give you a good idea of how useful the lists can be.

    In addition, below I included an illustrative image that shows the output produced by the previous (X)HTML file:



    Okay, at this point, I've shown you a practical example that illustrates how to put floating lists and paragraphs in the same web page. Hopefully, with this example at your disposal, you’ll quickly start using these handy lists with your own web sites!

    Even though the hands-on example that you just learned does show how to combine floating lists and paragraphs in a single web document, all of these elements present a fairly primitive look.

    Therefore, in the course of the next section, I’m going to incorporate a few additional CSS styles into the previous (X)HTML file, with the purpose of polishing its look and feel.

    Want to see how this will be done? Click on the link below and keep reading.

    More Style Sheets Articles
    More By Alejandro Gervasio


       · This last chapter of the series provides you with a few illustrational examples,...
     

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