{ LearnWebSiteDesign.com }

HTML, HTML5, XHTML, CSS and CSS3 Tutorials

CSS Syntax Tutorial

CSS Syntax

In CSS (cascading style sheets), a series of rules are applied to one or more HTML documents. Each rule is made up of two main parts: a selector and one or more declarations.

css syntax tutorial

Video Tutorial:
View our video tutorial to learn how to create HTML forms, text-fields, password fields, submit buttons and textareas.

selector The selector is typically the HTML element(s) that you want to apply the style(s) to. Following the selector is the declaration block.
declaration block Everything within the curly brackets ({ and }) is called the declaration block. Each declaration block is made up of one or more declarations. You can have as many declarations as you want to have within each declaration block.
Declaration Each declaration is made up of a CSS property and a value(s).
Property The property is the style attribute of the HTML element that you want to change.
Value The value specifies the change that you want made.

NOTE: The property is always followed by a colon (:) and each declaration is separated with a semicolon (;).

Selector: Specifies what HTML element(s) the styles should be applied to.
Declaration Block: Everything within the curly brackets ({ and }) is called the declaration block.
Declaration: A declaration is a combination of a property and its' value(s). Each declaration block can contain an unlimited number of declarations.
Property: The property is the style attribute that is to be changed. The property is followed by a colon (:)
Value: Value(s) assigned to the property. The last value is followed by a semi-colon (;)

An example of a CSS rule is shown below:

p { color:black; font-size:20px; }

A CSS rule can be placed on one line or on more than one line to make it more readable, for example:

p { color:black; font-size:20px; }

Comments in CSS

Comments are lines of text that you can place within your CSS code that will be ignored by web browsers. Commen

A CSS comment begins with a forward slash immediately followed by an asterisk (/*) and ends with and asterisk immediately followed by a forward slash (*/). CSS comments can span one or more lines. For example:

/* this is a comment and will be ignored by the web browser */ p { color:black; /* this is another comment that will be ignored by the web browser */ font-size:20px; }

Tutorials

Templates

References

Sponsors

You can get your website online using Velnet, a leading UK web hosting provider. They provide free template and installation for WordPress blogs. Discuss webmaster related topics at Webmaster Serve, a Webmaster SEO forum

SouthernWebGroup.com provides high quality website design in Atlanta, GA as well as around the world.

Find low cost cheap website hosting and domain registration.

Browser our free no ads web hosting directory and find the free web hosting that's right for you and your budget.

Advertise your web design and web development related products and services here.

Recommended

Download free css web hosting templates that are easy to edit at FreeWebHostingTemplates.com.

Friends