These articles cover the basics as well as cutting edge developments in HTML.  Home HTML and CSS Articles CSS {basic: syntax;} of a Rule

CSS {basic: syntax;} of a Rule


This tutorial is for those who are either new to CSS ( Cascading Style Sheets ) or would like to gain a basic understanding of the language. In this tutorial I will cover CSS terminology and the fundamental syntax of a CSS rule which is good to know if your interested in designing and styling for the web.

A style sheet can consist of as little as one, but usually several rules.

Each CSS rule (as displayed below) describes how a particular element within your HTML document will be displayed when someone visits your site on the web.

image 1

A rule can be broken down into several parts, each one serving a specific purpose.

  1. First we have to define a selector. A selector tells the browser exactly which element within our HTML document we plan to style.

    image 2

  2. Next we will declare how we wish to style the element within what is called a declaration block. A declaration block will always begin and end with an opening and closing curly brace.

    image 3

  3. Each declaration block can contain of one or many declarations in which styles are defined.

    image 4

  4. Now in each declaration we'll define our styles with predetermined CSS properties. Every property must be followed by a colon.

    image 5

  5. After you've decided which properties of the selector (HTML element) you plan to style it's then time to assign a value to each property. Each value must be followed by a semi-colon so that the browser is aware that it has reached the end of a declaration and can begin to look for the next one.

    image 6

Congratulations, you've just taken your first step toward becoming a Web Designer and down the road of code.



About the Author:

Click to Visit Author's Website My name is Chris Kapzynski, I’m a Graphic & Web Designer from the United States and founder of KapDesignStudio.com.
Author's URL: KapDesignStudio
These articles cover the basics as well as cutting edge developments in HTML. More Articles: Featured Materials | Fresh Materials | More HTML Tutorials at Markuptutorials.com

No comments yet...
Add comments to "CSS {basic: syntax;} of a Rule"

Captcha