CSS Coding Basics

Posted: Jul 14 in Web Design tagged by Peter

The benefits CSS coding can bring to your medical website are clear; however, people who are new to CSS layouts might wonder what all of the different tags mean and what they do.

Since CSS properties define how your website looks, specific tags are used to identify fonts, colors, backgrounds, image placement, columns, and any other aesthetics involved with your medical web site design. While some of these tags are self explanatory, others are not so easy to understand.

The Basics of CSS Coding Syntax

CSS syntax is different from HTML markup, as it’s broken into two main parts: the selector and the declaration (or declarations). The selector is where you identify which HTML element you wish to style using the CSS properties. For example, in the following syntax:

Header

h1 {color:green; font-size:18px;}

Header

h1 is the selector.

Declarations, on the other hand, describe the selector. This is what actually styles the different elements on your medical website. Declarations themselves are broken into two different parts as well: the property and the value. Referring back to the example above, the two declarations describe the color of the h1 element and the size of the font. The color:blue; declaration obviously is the CSS property that defines the color, and font-size is used to determine how large the text for any h1 element that occurs in your website will be.

A couple of important notes regarding CSS coding are that the declarations always need to end with a semi-colon. Notice in the example, a semi-colon follows the values of both declarations. Also, declarations, even if only one is used, need to be within the brackets { and }.

Leave Comment

(required)

(required)