Category: CSS Basics

CSS refers to Cascading style sheets


What is CSS?

Cascading Style Sheets is a style sheet language used for describing the presentation of a document written in a markup language.It is used to control the style of a web document in a simple and easy way.

  • CSS stands for Cascading Style Sheets
  • CSS describes how HTML elements are to be displayed on screen, paper, or in other media
  • CSS saves a lot of work. It can control the layout of multiple web pages all at once
  • External stylesheets are stored in CSS files

Various elements-

  1. Selector:A selector tells the web browser which element to style-like headline,paragraph or a link etc.In the above example the selector (p) refers to tag .This selector makes the browser style all the text in the <p> tags using the formatting directions.
  2. Declaration Block:The code following the selector that includes all formatting options you want to apply on the selector.The block beings with the opening { braces and ends with the closing }brace.
  3. Declaration:Between the opening and the closing blocks you add one or more declarations or the formatting instructions.Every declaration has two parts the property and the value for that property.It ends with a semicolon (;).
  4. Properties:properties refer to a wide range of formatting options available.A property is a word indicating certain style.Most properties have straight forward names-like font-size,color etc.
  5. Value:Finally one can style a webpages by providing a genius value to each property you assign to a selector. The properties require specific kind of values for example-color( red or #000),height( 90px or 10%) or a specific keyword (like top,bottom,left or right).