Style Sheets
  Home arrow Style Sheets arrow CSS: Top Secret Classification
IBM Developerworks
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  
Dedicated Servers  
Download TestComplete 
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

CSS: Top Secret Classification
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2008-04-14

    Table of Contents:
  • CSS: Top Secret Classification
  • Floating Elements
  • Floating Text for a Fairy Tale Look
  • Creating a Menu

  • 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
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    CSS: Top Secret Classification
    (Page 1 of 4 )

    This article will self-destruct in twenty seconds. Okay, not really; it will probably take you longer than that to read it, and you may even want to use it as a reference. In this mind-blowing episode, we discuss the many classification properties in CSS, all of which give you the ability to determine how and where your elements are displayed.

    Displaying Elements

    There are quite a few ways to display elements in CSS: inline, block, run-in, compact -- the list goes on and on. All those terms are probably a whole bunch of jibba-jabba to you at the moment, but don't worry fool! With the help of my good buddy Mr. T, we will clear it up for you in a jiffy:


    <html>

    <head>

    <style type="text/css">

    h3

    {

    display: inline

    }

    </style>

    </head>

    <body>

    <h3>A Horse is a horse</h3>

    <h3>Of course, of course</>

    <h3>Unless that horse is at McDonald's<h3>

    <h3>In which case it's lunch.</h3>

    </body>

    </html>

    The above uses an inline display, which shows the elements without any distance between them. The above displays as:

     

    A Horse is a horseOf course, of courseUnless that horse is at McDonald'sIn which case it's lunch.

    In the next example we will use the display block to force several spans to appear on several different lines, as opposed to together:


    <html>

    <head>

    <style type="text/css">

    span

    {

    display: block

    }

    </style>

    </head>

    <body>

    <span>A Horse is a horse</span>

    <span>Of course, of course</span>

    <span>Unless that horse is at McDonald's</span>

    <span>In which case it's lunch.</span>

    </body>

    </html>

    There are other ways to use the display properties, and here they are in a list:

    • none

    • inline

    • block

    • list-item

    • run-in

    • compact

    • marker

    • table

    • inline-table

    • table-row

    • table-row-column

    • table-row-group

    • table-header-group

    • table-footer-group

    • table-column-group

    • table-column

    • table-cell

    • table-caption

    Note that browser support of display is iffy, so be sure to check that your page looks right in multiple browsers (you should really be doing this anyway, you elitist swine!)

    More Style Sheets Articles
    More By James Payne


       · This article was great. It gave me the information I needed to know and an clear...
       · Thanks for stopping by to read my article. In this issue I discuss such topics as...
     

    STYLE SHEETS ARTICLES

    - Using PNG Images to Build Background Effects
    - CSS: Continuing the Clarification of CSS Cla...
    - CSS: Top Secret Classification
    - CSS: Dimensions
    - CSS: Margins and Padding
    - CSS: Crossing the Border
    - CSS: Text, Fonts, and Tables
    - CSS: Working with Text
    - CSS: Backgrounds
    - CSS for the Newbie
    - Styling Web Page Headers with Transparent Ba...
    - Creating Angled Corners with Transparent Bac...
    - Style Sheets for a Useful Links Page
    - Modifying the Look and Feel of Individual El...
    - Using Persistent Styles with Multiple Style ...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway