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  
Dedicated Servers  
Download TestComplete 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
eWeek
 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
     
     
    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: 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

    - 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 ...
    - Working with Multiple Style Sheets






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