Connecting Tech Pros Worldwide Help | Site Map

CSS Parameters

By Mark Hardy
Administrator, TheScripts.com

CSS Parameters

Cascading Style Sheets are used to set the appearance of many different aspects of a web page, without setting them in each individual element. Provided below are different stylesheet operations, and their respective options. At the end of the article there will also be a number of different examples.

Following is a basic example of how to insert a CSS style for an entire page.

<style> <!--P {font: oblique 650 10pt/12pt Verdana;}--> </style>

That style changes the properties for all elements inside P (or paragraph) tags to being oblique, having a weight of 650, being 10 points large, having line height of 12, and being in the font face Verdana. One more example to follow:

<style> <!--BODY {background: white url(background1.gif) no-scroll no-repeat top center;}--> </style>

This sets the BODY background to be white, using the image background1.gif as the tiled background, with no-scroll, no-repeat, and being aligned at the top page in the center.

Font Properties

font-family
Used to declare a specific font, a font family, or both at the same time.

a {font-family: Verdana, sans serif;}

font-style
Define whether the font will be italicized, oblique, or just normal.

a {font-style: italic;}

font-variant
Changes the way the font is presented, currently can be Small Caps, or normal.

a {font-variant: small-caps;}

font-weight
This operation sets the weight of the font (for example, you can set the weight of the bold tag in HTML).

B {font-weight: 500;}

font-size
Sets the size of the font, in absolute, relative or percentage-wise.

a {font-size: 150%;}

font
Allows you to set all the previously mentioned properties much quicker. However, it does require that you do everything in a specific order (you can leave out individual settings, just don't place them out of order).

a { font: font-style font-variant font-weight font-size/line-height font-family; }

  Color and Background »