CSS Tutorial

Top Reading

CSS Tutorial

CSS is used to control the style of a web document in a simple and easy way.

CSS is the acronym for "Cascading Style Sheet". This tutorial covers both the versions CSS1,CSS2 and CSS3, and gives a complete understanding of CSS, starting from its basics to advanced concepts.

Audience

This tutorial will help both students as well as professionals who want to make their websites or personal blogs more attractive.

Prerequisites

You should be familiar with:

  • Basic word processing using any text editor.
  • How to create directories and files.
  • How to navigate through different directories.
  • Internet browsing using popular browsers like Internet Explorer or Firefox.
  • Developing simple Web Pages using HTML or XHTML.

If you are new to HTML and XHTML, then we would suggest you to go through our HTML Tutorial or XHTML Tutorial first.

The Universal Selectors

Rather than selecting elements of a specific type, the universal selector quite simply matches the name of any element type −

* { 
   color: #000000; 
}

This rule renders the content of every element in our document in black.

The Descendant Selectors

Suppose you want to apply a style rule to a particular element only when it lies inside a particular element. As given in the following example, style rule will apply to <em> element only when it lies inside <ul> tag.

<p class="center bold">
   This para will be styled by the classes center and bold.
</p>