Wednesday, April 29, 2015

CSS Introduction

What is CSS ?

Cascading Style Sheets (CSS) is a style sheet language used for describing the look and formatting of a document written in a markup language.


CSS Solved HTML Page Problem


HTML was NEVER intended to contain tags for formatting a document.
HTML was intended to define the content of a document, like:

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

When tags like <font>, and color attributes were added to the HTML 3.2 specification, it started a nightmare for web developers. Development of large web sites, where fonts and color information were added to every single page, became a long and expensive process.

CSS file Saves a Lot of Work

The style definitions are normally saved in external .css files.
With an external style sheet file, you can change the look of an entire Web site by changing just one file.

CSS Syntax 


A CSS rule set consists of a selector and a declaration block 

CSS selector
CSS Syntex Diagram

The selector points to the HTML element you want to style.
The declaration block contains one or more declarations separated by semicolons.
Each declaration includes a property name and a value, separated by a colon.

Ex:

In Html File :

<p> welcome to weblbox </p>

In CSS File :

{
    color: red;
    text-align: center;
}



Posted in:

0 comments:

Post a Comment

Thanks For Coming The Page.