• Uncategorized
27 May 2008

Creating Your CSS

Basically, there are three key areas that you need to look into in creating your Cascading Style Sheets, and these are: the selector, the property and the value.

The selector is id title or the class or element in which the format will be applied. The property is the basic information that tells you how to format a selector; and lastly, the value is the real style to be based upon by the property on the selector. If you want every paragraph in your document to have the same font, then you can do that by following the CSS: p {font-family : arial;}. The “p” represents the selector which means that every text within its realm is affected with a specific style. The font-family suggests that all font-family be changed; and the “arial” is the value which typically changes everything to an Arial font.

The format of setting up your style follows a specific method. It should be in this way at all times: selector { property : value ; property2 : value ;}. The curly braces are used to cluster the styles for every selector. The colon is used to separate the value form the property; and finally, the semi colon ends each style declaration. It is important to remember that the semi colon is used to part a multitude of styles; but it is a great idea to have it included at all times. By doing so, it would be easier adding more styles in your CSS.

Typically, the selector is an HTML tag; but you can craft a variety of classes and ID’s. These selectors are being utilized if you are quite unsure about which style to use. For instance, you may prefer having a “highlight” selector which changes the tiling to some other color. Here is how to do it: .highlight { background-color : #ffff00;}. To be able to utilize such style, you can configure the HTML tags as: <h2 class=”highlight”>This headline is highlighted</h2>. Another way to write it would be: <span class=”highlight”></span>. This is much simple and it will allow you to specify which of the texts should be highlighted.

Tags:

This entry was posted on 27 May 2008 at 6:08 PM and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment