Style Sheets
  Home arrow Style Sheets arrow Page 3 - CSS: Text, Fonts, and Tables
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

CSS: Text, Fonts, and Tables
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-03-17

    Table of Contents:
  • CSS: Text, Fonts, and Tables
  • Word Wrapping
  • Adjusting Your Font Size
  • Fonting with Style
  • How to Set the Boldness of a Font
  • Tables in CSS

  • 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


    CSS: Text, Fonts, and Tables - Adjusting Your Font Size


    (Page 3 of 6 )

    There are two ways to adjust your font size in CSS and we are about to take a peek at both. I know, it's exciting, but try to contain yourself.

    Changing Font Size Using Percentage


    <html>

    <head>

    <style type="text/css">

    h1 {font-size: 100%}

    h2 {font-size: 120%}

    h3 {font-size: 130%}

    h4 {font-size: 140%}

    h5 {font-size: 150%}

    h6 {font-size: 160%}

    p {font-size: 170%}

    b {font-size: 30%}

    </style>

    </head>

    <body>

    <h1>How come trees aren't fat?</h1>

    <h2>I mean all they do is sit there and eat and drink all day.</h2>

    <h3>They never exercise or anything</h3>

    <h4>Lazy bastards.</h4>

    <h5>I mean they rely on the wind to move their leaves.<h5>

    <h6>I'm fat.</h6>

    <p>You know what? This paragraph is fat too.</p>

    <span><b>Disco. That is all.</b></span>

    </body>

    </html>


    Changing Font Size with Numbers


    <html>

    <head>

    <style type="text/css">

    h1 {font-size: 10}

    h2 {font-size: 20}

    h3 {font-size: 30}

    h4 {font-size: 40}

    h5 {font-size: 50}

    h6 {font-size: 60}

    p {font-size: 70}

    b {font-size: 130}

    </style>

    </head>

    <body>

    <h1>How come trees aren't fat?</h1>

    <h2>I mean all they do is sit there and eat and drink all day.</h2>

    <h3>They never exercise or anything</h3>

    <h4>Lazy bastards.</h4>

    <h5>I mean they rely on the wind to move their leaves.<h5>

    <h6>I'm fat.</h6>

    <p>You know what? This paragraph is fat too.</p>

    <span><b>Disco. That is all.</b></span>

    </body>

    </html>


    Setting the Size of Fonts with Your Pants Size


    <html>

    <head>

    <style type="text/css">

    h1 {font-size: xx-small}

    h2 {font-size: x-small}

    h3 {font-size: small}

    h4 {font-size: medium}

    h5 {font-size: large}

    h6 {font-size: x-large}

    p {font-size: xx-large}

    b {font-size: smaller}

    p.fool {font-size: larger}

    </style>

    </head>

    <body>

    <h1>How come trees aren't fat?</h1>

    <h2>I mean all they do is sit there and eat and drink all day.</h2>

    <h3>They never exercise or anything</h3>

    <h4>Lazy bastards.</h4>

    <h5>I mean they rely on the wind to move their leaves.<h5>

    <h6>I'm fat.</h6>

    <p>You know what? This paragraph is fat too.</p>

    <span><b>Disco. That is all.</b></span>

    <p name="fool"><i>Grease is the word is the word is the word</i></p>

    </body>

    </html>

    More Style Sheets Articles
    More By James Payne


       · Welcome to my article in an ongoing series on CSS. Here, in this episode, we discuss...
       · "table-layout:" should be "auto". A CSS2 validation error occurs with table-layout:...
       · Hey, thanks for catching that. I'll be sure to change it in the...
     

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