CSS is a useful and efficient tool for specifying the presentation of HTML webpages
It
can control almost all the details of their appearance, from simply
styling the content (colour, bold, etc.) to completely controlling the
page layout.
What is CSS File?
CSS stands for Cascading Style Sheets
| File extension:
|
.css
|
|
MIME type:
|
text/html
|
|
Type code:
|
TEXT
|
|
Uniform Type Identifier:
|
public.html
|
|
Developed by:
|
World Wide Web Consortium (W3C)
|
|
Type of format:
|
How to Display HTML Elements
|
|
Extended to:
|
CSS2
|
|
Standard(s):
|
CSS1,CSS2,CSS2.1
|
|
Cascading
Style Sheets (CSS) are a way to control the look and feel of your HTML
documents into an organized and efficient manner.
|
|
With CSS you will be able to:
|
|
A CSS file must have a .css file extension
|
|
A CSS file can be created using a simple text editor
|
|
CSS is a program that runs inside Web Browser
|
|
Scripts in CSS file are executed on the Client
|
What Is CSS?
|
|
- CSS stands for Cascading Style Sheets
- Styles define how to display HTML elements
- Styles are normally stored in Style Sheets
- Styles were added to HTML 4.0 to solve a problem
- External Style Sheets can save you a lot of work
- External Style Sheets are stored in CSS files
- Multiple style definitions will cascade into one
Intended Audience
We suggest
that you check to see you meet the following recommendations before you begin the CSS Tutorial :
- You have used HTML before.
- You have basic idea about HTML tags and vocabulary.
- You want to be a better web designer!
If you do not, we recommend that you check out our
HTML Tutorial before
taking on CSS.
When you are ready, continue the tutorial to learn about the
basic form of CSS and where you should place your CSS code.
Styles Solve a Common Problem
|
|
To define the content of a document,HTML tags were originally designed.By using tags like <h1>,
<p>, <table>,they were supposed to say "This is a header", "This
is a paragraph", "This is a table" and so on.Without using any formatting
tags ,the layout of the document was supposed to be taken care of by the browser.
It became more and more difficult to create Web
sites where the content of HTML documents was clearly separated
from the document's presentation layout as the two major browsers - Netscape and Internet
Explorer - continued to add new HTML tags and attributes (like
the <font> tag and the color attribute) to the original HTML
specification .
To solve this problem, the World Wide Web Consortium (W3C) -
the non profit, standard setting consortium, responsible for
standardizing HTML - created STYLES in addition to HTML 4.0.
Cascading Style Sheets is supported by all major browsers .
|
Style Sheets Can Save a Lot of Work
|
|
HOW HTML elements are to be displayed is defined by Styles sheets ,
just like the font tag and the color attribute in HTML 3.2.
Styles are normally saved in external .css files. you can change the appearance and layout of all the
pages in your Web using External style sheets , just by editing one single CSS document!
CSS allows developers to control the style and layout of multiple Web pages all at
once so that it is a breakthrough in Web design . It is possible to define a style for each HTML
element and apply it to as many Web pages as you want.To make a global change,all elements in the
Web are updated automatically by simply changing the style.
|
|
» Multiple Styles Will Cascade Into One
|
|
To be specified in many ways,Style Sheets allow
style information. Inside a single HTML element which can be inside the
<head>element of an HTML page, or in an external CSS file,Styles
can be specified. Even inside a single HTML document,multiple external
style sheets can be referenced.
|
|
Cascading Order
|
|
» What style will be used when there is more than one style specified for an HTML element?
|
|
By the following rules, all the styles will
"cascade" into a new "virtual" style sheet , whereas fourth one has the highest priority:
- Browser default
- External style sheet
- Internal style sheet (inside the <head> tag)
- Inline style (inside an HTML element)
Inline style sheet will override a style declared
inside the <head>that's why an inline style (inside an HTML element) has the highest
priority in comparision to an external style sheet, or in a
browser (a default value).
|
|
» What You Should Already Know?
|
|
You should have some basic understanding
of the following before you start:
If you want to study this subject first, find the tutorials
on HTML Tutorial Guide.
|
|
|
|