Home arrow Style Sheets arrow Page 3 - CSS: Text, Fonts, and Tables
STYLE SHEETS

CSS: Text, Fonts, and Tables


We last left off discussing text in CSS. In this article we will finish this discussion, and cover how to manipulate fonts as well. And if time permits, we will also go over tables in CSS. It's a lot of ground to cover, so let's jump right in.

Author Info:
By: James Payne
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
March 17, 2008
TABLE OF CONTENTS:
  1. · CSS: Text, Fonts, and Tables
  2. · Word Wrapping
  3. · Adjusting Your Font Size
  4. · Fonting with Style
  5. · How to Set the Boldness of a Font
  6. · Tables in CSS

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

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>


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials