Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us
Promos and Premiums
Memory Upgrades
Hurricane Shutters
Laptops
Promote Your Website
Server Racks
KVM Switch over IP
Career Education
Imprinted Promotions
Baby Photo Contest
Compare Prices
Home Improvement
Cell Phones
Imprinted Gifts

Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Install What You Need with Windows Server 2008
Windows Server 2008 is Microsofts most full-featured server operating system yet, so it's ironic that one of its most exciting new features is an install option that cuts out most of the other features. Paul Rubens explores why a Server Core installation makes a great deal of sense in many instances. »

 
Identify Hardware and Software That Meet Microsoft Standards
The "Certified for Windows. Server 2008" logo identifies hardware and software solutions that meet Microsoft standards for compatibility and best practices with the Windows Server 2008 operating system. »

 
Windows Server Catalog: Certified Hardware Devices
Search the Windows Server 2008 catalog to find solutions to deploy with confidence. »

 
Windows Server Catalog: Certfied Servers
Search the Windows Server 2008 catalog to find servers you can deploy with confidence. »

 
Download the Windows Server 2008 Trial
With Windows Server 2008 you can develop, deliver, and manage rich user experiences and applications, provide a secure network infrastructure, and increase technological efficiency and value within your organization. »
Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

July 26, 1998

Putting Style Sheets in Perspective

font-size

Initial Value:
medium
Allowed Values:
absolute-size
relative-size
length
percentage
inherit
Applies to:
all elements
Inherited?:
yes

The font-size property specifies
the size of the font,
just as you would expect.

absolute-size


Values for absolute-sizes are computed and kept by the browser, and the value is specified as a keyword. The following table shows the syntax for specifying absolute-size within the style attribute.

Absolute Values:
xx-small | x-small | small | medium | large | x-large | xx-large
<P style="font-size: xx-small">xx-small</P>

xx-small

<P style="font-size: x-small">x-small</P>

x-small

<P style="font-size: small">small</P>

small

<P style="font-size: medium">medium</P>

medium

<P style="font-size: large">large</P>

large

<P style="font-size: x-large">x-large</P>

x-large

<P style="font-size: xx-large">xx-large</P>

xx-large

The above example shows the absolute-size value applied via the style attribute. Adding the font-size to a large portion of a document or a series of documents with the Style Attribute is as much work, if not more, as adding <FONT SIZE="+1"></FONT>. It makes much more sense to apply the font-size, (or any other property), through the use of the Style Element. The example below shows it applied to the P element within the style element. Now, wouldn't you rather type this single line once than add FONT SIZE over and over?

P	{ font-size: large;}

CSS2 suggests user agents use a scaling factor of 1.2 In English, this means that if the medium font is 14pt, the large font would be 14 x 1.2 for a final size of 16.8. The sizes may vary from one font family to another.

relative-size

Relative-size is 'relative' to the document or parent element.

All documents have a font size, if it is not specified, then it will default to what ever size is specified by the user agent. Suppose the document default size is medium, then an element that has a relative font size of larger will be displayed as large text. If that same element is the child of another element that has a specified font size of medium, then 'larger' will display as large. Add yet another child element with a relative-size value of larger and it will display as extra large.

Relative Values:
larger | smaller
<P style="font-size: medium">
medium<BR>
<EM style="font-size: larger">large<BR>
<B STYLE="font-size: larger">larger</B>
</EM>

medium
large
larger

In the above example, P had an absolute-size of medium.
EM, a child of P had a relative size of larger,
B, a child of EM also had a relative size of larger.
Because of inheritance, B was relative to EM and not to P.

length

You may specify an absolute size in points, millimeters, centimeters, inches, pixels or other units with the length value.

Lengths refer to horizontal or vertical measurement and are specified with [+-][number][unit identifier], with no spaces between the characters.

H1  { font-size: 1cm }

header

H1	{ font-size: 0.5in }

header

The two types values that may be applied to length are relative and absolute. Relative lengths specify a length relative to another length while absolute lengths are dependent on the user agent. Absolute lengths are not reliable as they may render difficult to read due to individual browser configurations.

length values: 1
Relative
  • em: font-size is relevant to the parent element font-size
  • ex: font height relevant to the parent element font-size. ex is determined by the x-height or height of the lowercase "x".
  • px: font-size relative to the resolution of the viewing device
Absolute
  • in: inches -- 1 inch is equal to 2.54 centimeters.
  • cm: centimeters
  • mm: millimeters
  • pt: points -- the points used by CSS2 are equal to 1/72th of an inch.
  • pc: picas -- 1 pica is equal to 12 points.

EM is a unit of measure that is relative to the font size.2 In CSS, em is the font size. It's a scalable unit, i.e. changes proportionally to the font size, as opposed to 'fixed' measures such as points. It's used typically for the indent of the first line of a paragraph or for indenting the left margin of a list or spacing between paragraphs.

ex

EX is a unit of measure that is relative to the font size. The measurement is equal to the fonts lowercase 'x', although an ex value will be defined even if the font doesn't have a lowercase 'x'.

Pixel units are relative to the screen resolution of the viewing computer.

Child elements do not inherit the relative values specified for their parent; they (generally) inherit the computed values.2

Percentage

Percentage is relative to the parent element's font size. The percentage value is the parent's font-size times the percentage. A percentage of 120% will increase the size by 20%.

<STYLE TYPE="text/css">
<!--
.special {font-size: 12pt;}

.twenty {font-size: 120%;}
-->
</STYLE>
</HEAD>
<BODY>


<B class="special"> small font <I class="twenty">twenty percent larger</I> </B>
small font twenty percent larger

Notes:

1.W3C
2. Cascading Style Sheets

Additional Resources:

Putting Style Sheets in Perspective:font-weight
Putting Style Sheets in Perspective: Table of Contents
Putting Style Sheets in Perspective: font


Up to => Home / Authoring / Style / Sheets / Fonts




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers