Style-Sheets
  Home arrow Style-Sheets arrow Page 4 - Understanding Style Sheets (part 2)
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
OLM
 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

Understanding Style Sheets (part 2)
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 24
    2000-10-04

    Table of Contents:
  • Understanding Style Sheets (part 2)
  • Bringing Out The Decorations
  • Gimme My Space!
  • Reclining Every Which Way
  • Above The Watermark
  • Going Shopping
  • The View From The Top
  • The Z-Factor

  • 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

    Virtual Tradeshows by Ziff Davis Enterprise - A Unique Opportunity to Connect with IT Experts, Access Information, and Gain Insight on today's Technology

    Understanding Style Sheets (part 2) - Reclining Every Which Way
    (Page 4 of 8 )

    Horizontal alignment takes place via the "text-align" property, which accepts the values "left", "right", "center" and "justify", while vertical alignment happens via the "vertical-align" property, which can take any of the following values: "baseline", "text-top", "text-bottom", "middle", "'sub", "super", "top", and "bottom".

    Most of these are self-explanatory, but the following example will make things clearer:
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    <P STYLE="text-align: center; 
    font-weight: bolder">
    Thoughts to live by!
    <P STYLE="text-align: left">
    Condense 
    soup, not books
    <P STYLE="text-align: right">
    <IMG SRC="bullet.gif" HEIGHT="25" 
    WIDTH="25">Crime doesn't pay, but the
    hours are good.
    <P STYLE="text-align: 
    justify">
    <IMG SRC="bullet.gif" HEIGHT="25" WIDTH="25">Do you know that if 
    all the
    smokers were laid end to end around the world,
    three quarters of them 
    would drown?
    <P STYLE="vertical-align: sub">
    <IMG SRC="bullet.gif" HEIGHT="25" 
    WIDTH="25">Elvis is dead, Mozart is dead,
    Einstein is dead, and I'm not feeling 
    so
    great myself.
    <P STYLE="vertical-align: super">
    <IMG SRC="bullet.gif" 
    HEIGHT="25" WIDTH="25">Ever stop to think, and forget
    to start again?
    <P STYLE="vertical-align: 
    top">
    <IMG SRC="bullet.gif" HEIGHT="25" WIDTH="25">For people who like peace 
    and
    quiet - a phoneless cord.
    </BODY>
    </HTML>
    
    The "text-transform" property allows you to change the capitalization of text - choose between "uppercase", "lowercase", "capitalize", and "none".
    <HTML>
    <HEAD>
    <STYLE TYPE="text/css">
    .question {text-transform: capitalize} 
    /* first character capitalized*/
    .answer {text-transform: uppercase} /* all characters 
    capitalized */
    </STYLE>
    </HEAD>
    <BODY>
    <P CLASS="question">
    Q. How 
    many paranoid people do you need to change a light-bulb ??
    <P CLASS="answer">
    A. 
    And who's asking???!!!!
    </BODY>
    </HTML>
    
    And the "line-height" property allows you to alter the space between lines, thereby giving you the power to overlap text segments on each other. Warning: this is addictive!
    <HTML>
    <HEAD>
    <STYLE TYPE="text/css">
    .question {font-size: 30pt; text-transform: 
    capitalize; line-height: 60px}
    .answer {font-size: 50pt; color: red; text-transform: 
    uppercase;
    line-height: 20px}
    </STYLE>
    </HEAD>
    <BODY>
    <P CLASS="question">
    Q. 
    How many paranoid people do you need to change a light-bulb ??
    <P CLASS="answer">
    A. 
    And who's asking???!!!!
    </BODY>
    </HTML>
    

    More Style-Sheets Articles
    More By icarus, (c) Melonfire


     

       

    STYLE-SHEETS ARTICLES

    - What is CSS?
    - The Power of CSS
    - Understanding Style Sheets (part 2)
    - Understanding Style Sheets (Part 1)

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




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