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
Televisions
Find Software
Hurricane Shutters
Promotional Gifts
Computer Hardware
KVM over IP
Memory Upgrades
Online Shopping
Home Improvement
Imprinted Gifts
Car Donations
Remote Online Backup
KVM Switches
Best Price

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


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

Initial Value:
See individual properties
Allowed Values:
font-style
font-variant
font-weight
font-size
line-height
font-family
inherit
Applies to:
all elements
Inherited?:
yes


The font property is a shorthand method of including all of the previous font properties in one rule.

So, it's about time we got a shortcut for all that typing. But how do we put it together? It's really pretty simple.

In our example, we'll use the P element as the selector. Follow the Selector with your Declaration. Suppose we wanted to add an italic bold text. We want it to be 12pts with a line height of 14pts, and we want it in the sans-serif family. That's going to be an awful lot of typing for just one text style, isn't it.

But, it's not near as bad as it sounds, nor as confusing. Using the font property, we don't have to type each property, just the values.

Our rule would look like this:

P	{ font:	italic bold 12pt/14pt Arial, Verdana, sans-serif }

The different values are separated only by a space while the font-family options are separated by commas. The font-size and line-height are separated by a forward slash.

The table below shows you an example of the font-property, what you would have typed 'longhand' and what it really means if you'd typed the properties which you aren't setting explicitly. When a property is not explicitly set, it will default to its initial value. In the example below, we did not set font-variant or line height. Since we didn't specify these properties, they automatically take the default value of normal.

P	{ font: italic bold small Arial, Verdana, sans-serif}
is the same as:
P	{	font-style	:	italic;
		font-weight	:	bold;
		font-size	:	small;
		font-family	:	Arial, "Verdana", sans-serif;
	}
and really means this:
P	{	font-style	:	italic;
		font-variant	:	normal;
		font-weight	:	bold;
		font-size	:	small;
		line-height	:	normal;
		font-family	:	Arial, "Verdana", sans-serif;
	}

Additional Resources:

Putting Style Sheets in Perspective:font-size
Putting Style Sheets in Perspective: Table of Contents
Putting Style Sheets in Perspective: line-height


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