What is CSS?
A Cascading Style Sheet (CSS) file allows you to separate your website's (X)HTML content from its style. As always you use your (X) HTML file to arrange the content, but all of the presentation (fonts, colors, background, borders, text formatting, link effects & so on...) are accomplished within a CSS.
Slow Rise of CSS
CSS1 marked its first appearance as a standard in late 1996 and CSS2 quickly followed in 1998. Newer versions of browsers are far better than their predecessors, and now have good support for CSS1 and CSS 2.1 as well as many features from CSS3. Yet even as CSS support has become more commonplace, significant issues remain. Browser bugs still exist, portions of the CSS specification remain unsupported, developer education and uptake are lagging, and proprietary extensions to style sheets are rapidly being introduced by browser vendors. It seems the more things change the more they stay the same regardless of the technology in use.
Start CSS
CSS rules are defined as a property name followed by a colon and then a property value. Individual rules are terminated by semicolons, with the final rule having an optional semicolon as in the following.
property-name1 : value1; ... property-nameN : valueN;
CSS rules are placed directly within most HTML tags by setting the core attribute style to the rule. For example, to set the color and alignment of an h1 heading.
<h1 style="color: red; text-align: center;">Big CSS!</h1>
This type of direct use of CSS is known as Inline Style and is the least favorite form of CSS because of its tight coupling to the actual (X)HTML tags. Instead of placing the rules directly within the markup elements, we create a rule that binds to a specific element or a set of elements, that will also be for future reuse.
CSS rules not found within a specified tag consist of a Selector followed by its associated style declarations within curly braces. The syntax of the Selector.
Selector {property1: value1; property: valueN ;}

CSS property names are separated by dashes when they are multiple words. For instance, font face, font size, line height, and so on. And if we see values, they also exist in many forms; from small keywords like xx-small, strings like Arial, plain numbers like 0, numbers with a unit like 100px or 2 cm, and some special delimited values such as URLs, URL (... /style/fancy.css).
To create a style dictating that all h1 elements are yellow and centered, use the following rule.
H1 {color: yellow; text-align: center;}
CSS is not whitespace sensitive, so:
H1 {font-size: xx-large; color: red; font-family: Arial;}
Will render the same as:
H1 {font-size: xx-large;
color: red;
font-family: Arial ;}
CSS also allows comments /* */.
For example:
/* first CSS rule below*/
h1 {font-size: 28px; color: red; font-family: Arial;}
Remember point
When publishing CSS and HTML on public-facing Websites, remove comments and reduce white space to improve delivery and perfect execution.
CSS is Case-Sensitive or not!!
In CSS, property names and many values are case insensitive.
h1 {FONT-SIZE:25px;color:RED;FONT-WEIGHT:bold;}
And
h1 {font-size:28px;color:red;font-weight:bold;}
Are the same. But if we see cases type such as with URL values, font names, and certain selectors such as id and class values, CSS considers that as case-sensitive.
For example
#foo {background-image url(tile.gif); font-family: Arial;}
And
#FOO {background-image url(TILE.GIF); font-family: AriaL;}
In the example given above, both cases are different because in the URL case sometimes it depends on the Web server, the fonts potentially do not match, and the differing id selectors possibly do not work. That can be confusing, it is much safer to assume that CSS is case-sensitive.
CSS Example

Code Used
<!DOCTYPE html>
<html>
<head>
<style>p{color: blue;text-align: center;}</style>
</head>
<body>
<p>C# Corner</p>
<p>
Learn CSS.
</p>
</body>
</html>
Save

Result

How to use CSS, either externally or internally?
First, we explore the Internal style sheet method. In this way, you are simply placing the CSS code within the <head> </head> tags of each (X)HTML file you want to style with the CSS.
For Example
<head>
<title>
<title>
<style type="text/css"> CSS Content Goes Here </style>
</head>
<body>
With this method, each (X)HTML file contains the CSS code needed to style the page. This means that any changes you want to make to one page will need to be made to all. This method can be good if you need to style only one page, or if you want each page to have a different style.
External Stylesheet
An external CSS file can be created with any text or HTML editor such as "Notepad" or "Dreamweaver". A CSS file contains no (X)HTML, only CSS. You simply save it with the .css file extension. You can link to the file externally by placing one of the following links in the head section of every (X)HTML file you want to style with the CSS file. You can also use the import method as shown below.
<style type="text/css">@import url(Path To stylesheet.css)</style>
Either of these methods is done by placing one or the other in the head section.
For Example
<head>
<title>
<title>
<style type="text/css"> CSS Content Goes Here </style>
</head>
<body>
<link rel="stylesheet" type="text/css" href="Path To stylesheet.css" />
Or:
<head>
<title>
<title>
<style type="text/css"> @import url(Path To stylesheet.css) </style>
</head>
<body>
By external Style, Sheet means, that if you need to alter the design of all your pages, you only need to edit one .css file to make global changes to your entire website.
The Two Most Common Forms of CSS
The two most common forms of CSS rules are id selectors, which are used to specify a rule to bind to a particularly unique element, and class selectors, that is used to specify a group of elements.
The id selector specifies a style for a single, unique element. The id selector uses the id attribute of the HTML element, and is defined with"#". The style rule below will be applied to the element with id="demo"










Arjun DhilodPosted Sep 16, 2013, 3:25 AM
As you r mentioned you r Microsoft certified so accept good coding use ARTICLE from you end
Arjun DhilodPosted Sep 16, 2013, 3:22 AM
all in one CSS
siva kumarPosted Jul 26, 2013, 6:10 AM
good article tripati thank you for the nice article.
Dinesh BeniwalPosted Jul 18, 2013, 4:54 AM
Good Work Tripti.