Style-Sheets
  Home arrow Style-Sheets arrow Page 6 - Understanding Style Sheets (Part 1)
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 
 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 1)
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 31
    2000-09-27

    Table of Contents:
  • Understanding Style Sheets (Part 1)
  • Into The Light
  • More Pseudo-Gibberish
  • The Colour Of My Eyes
  • Playing With Type
  • Adding A Little Style

  • 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

    Dell PowerEdge Servers

    Understanding Style Sheets (Part 1) - Adding A Little Style
    (Page 6 of 6 )

    You can also add emphasis to your text with the "font-style" property,
    which takes the values "normal", "oblique" and "italic". Check it out!

    <HTML>
    <HEAD>
    <STYLE TYPE="text/css">
    P {font-family: serif; font-style: italic} /* italic font */
    </STYLE>

    </HEAD>

    <BODY>

    <P CLASS="question">
    Q. How many testers does it take to change a light bulb?
    <P CLASS="answer">
    A. We just noticed the room was dark; we don't actually fix the problem.

    </BODY>
    </HTML>

    Speaking of emphasis, the "font-weight" property allows you to control the level of emphasis either via keywords like "normal", "bold", "bolder" and "lighter", or via an absolute scale going from 100 to 900. Take a look:

    <HTML>
    <HEAD>
    <STYLE TYPE="text/css">
    .question {font-weight: bolder}
    .answer {font-weight: 900}
    </STYLE>

    </HEAD>

    <BODY>

    <P CLASS="question">
    Q. How many testers does it take to change a light bulb?
    <P CLASS="answer">
    A. We just noticed the room was dark; we don't actually fix the problem.

    </BODY>
    </HTML>

    And finally, the "font-variant" property allows you to specify the capitalization of the text - your options are either "small-caps" or "normal". Note that Netscape doesn't seem to support this property yet.

    <HTML>
    <HEAD>
    <STYLE TYPE="text/css">
    P {font-variant: small-caps} /* replace all lower-case characters with
    upper-case characters */
    .</STYLE>

    </HEAD>

    <BODY>

    <P>
    Q. How many testers does it take to change a light bulb?
    <P>
    A. We just noticed the room was dark; we don't actually fix the problem.

    </BODY>
    </HTML>

    In the second part of this article, you'll learn how to control margins, padding, borders, background images and a whole lot more. Make sure you come back for that one!


    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.

     

       

    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 2 hosted by Hostway