Academic Tutorials



English | French | Portugese | German | Italian
Home Advertise Payments Recommended Websites Interview Questions FAQs
News Source Codes E-Books Downloads Jobs Web Hosting
Chats

CSS 2.0
CSS 2.0 Introduction
CSS 2.0 Attaching Style
CSS 2.0 Applying Style
CSS 2.0 Key Concepts
CSS 2.0 Color Contents
CSS 2.0 Fonts Contents
CSS 2.0 Text
CSS 2.0 Lists
CSS 2.0 the box model
CSS 2.0 Advanced concepts
CSS 2.0 Positioning
CSS 2.0 Boxes
CSS 2.0 Generated content
CSS 2.0 Dynamic effects
CSS 2.0 Tables
CSS 2.0 Paged media
CSS 2.0 Font Face
CSS 2.0 Aural Style Sheets
CSS 2.0 Language styles

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
HLML
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
PHP
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
OOPs
Data Warehousing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting
Network Sites


Introduction to CSS 2.0


home Next






Introduction to CSS2


A D V E R T I S E M E N T



Introduction

This is one of very few CSS2 tutorials on the net. Not only does it have that advantage, but also has the following advantages:

  1. It is easy to understand
  2. It covers every aspect of the specification, including those that are frequently not touched upon by other tutorials such as cascading, box width calculations, etc.
  3. It presents information in an efficient manner - it is short, so you learn faster
 




What are style sheets

Style sheets provide a means for authors to specify how they wish documents written in a markup language such as XML or HTML to be formatted. For example, an author might wish to specify that a document should be green on pink - this could be done using CSS, an established standard for styling documents.

You might ask 'Why do we need style sheets - can't you use HTML; for example, the FONT element or the bgcolor attribute?'

There are two answers to this:

  1. HTML isn't designed for styling documents - when you write an HTML document, you are specifying only the content that the element contains. Given the piece of HTML: <H1>A heading</H1>, you have specified nothing about the way the element should be rendered, only that the element is a level 1 heading. If you wished to state that you want your headings to be yellow Helvetica, then you could have <H1><FONT color="yellow" face="Helvetica">A heading</FONT></H1>, but this is bad for several reasons:
    1. You have to add that piece of code to each heading that you want styled - this is time-consuming, prone to error and makes files excessively bloated (a typical page styled using HTML will be 1/3rd formatting tags).
    2. If you want to change those headings to pink Arial, then you will have to change each heading individually - a prohibitively laborious task on a large site.
  2. HTML simply doesn't offer sufficient control over document formatting - important formatting effects such as leading (the space between lines), text shadows, and many other effects just can't be done using HTML.

Style sheets solve all of these problems. For example, say you want to make all those headings green Arial - no problem, just type H1 {font-family: Arial; color: green}. What if you want to change all of the headings on your site to red with a blue background? Just change that to H1 {color: red; background: blue}, and, at a stroke, the whole of the site is changed.

What can style sheets do?

To take an example, on this page all of the headings are reddish brown - this is so on every page on RichInStyle.com. This probably adds up to about 10000 headings.

If each of those headings were to be styled with a font element (e.g., <H2><font color="blue">A heading</font></h1>), that would take up 250kb - a significant amount of space. By replacing this with a CSS rule, the whole site can be styled with a single rule amounting to only about 40 bytes.

Assuming an average of 50,000 downloads per page, per month, that works out at a saving of 12.5gb.

That is a lot of saved space, especially if you pay for bandwidth by the gigabyte.

Just imagine the cumulative effect of that across all the margins, colors and fonts on the site, and that is a lot of saved traffic, so not only are cost reduced, but also the download speed will increase for viewers of your pages.

 



Why style sheets?

Style sheets have the following advantages:

  1. They separate content from formatting. This means that instead of marking a quotation as italic, you mark it as a quote and then tell the browser that you want all quotes to be italic. This means that it is a two-second job to change quotes to bold, red, green or normal.
  2. They reduce download time by removing formatting information from documents. Thus instead of having to specify that you want Times New Roman a few dozen times in a file for headings, you specify once that you want headings to be Times New Roman. They also are advantageous in that they need only be downloaded once for an entire website.
  3. They give far more control over formatting than HTML - such features as background images and colors on all elements - not just the whole document, etc.
  4. They ensure a consistent appearance across a site



What reasons are there not to use style sheets?

  1. About 1 in 20 users have browsers that do not support style sheets.
  2. Not all browsers support style sheets properly.



Support

Be aware that since CSS is a large specification, most browsers do not support it in its entirety. Given that this is so, don't be surprised if some concepts described in this guide don't work.




Using style sheets

Style sheets allow you to say, for example, that you want headings in 30px Arial with a pink background, that you want the whole document to have a left margin of 1in, or whatever. The good thing about them is that they are the only way that you can say that you want BODY or P to be displayed in a certain way - in HTML you could make all P tags a certain color using HTML tags, but if you wanted to change them it would take hours on a big website, but seconds using CSS.

For example:

BODY {color: red;
background-color: white;
font-size: 16px;
font-family: Arial;
line-height: 20px;
margin-left: 5%}

As you can see, creating a style sheet is easy, but before you can do that, it is necessary to decide how you are going to attach your style to your page.



View comments on this page.

Posted By Vinotha Selva on: Tuesday, April 13, 2010
Thanking
It is a very nice article well explanatory. I got few more ideas also from this page. Thanks




  CSS 2.0 eBooks
More Links » »
 
 CSS 2.0 FAQs
More Links » »
 
 CSS 2.0 Interview Questions
More Links » »
 
 CSS 2.0 Articles

No CSS 2.0 Articles could be found as of now.

 
 CSS 2.0 News

No News on CSS 2.0 could be found as of now.

 
 CSS 2.0 Jobs

No CSS 2.0 Articles could be found as of now.


Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previoushome Next

Keywords: Introduction to CSS2, CSS2, css2, CSS2 tutorial, CSS2 tutorial pdf, history of CSS2, Custamizing Style Sheet, learn CSS2

HTML Quizzes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
HLML Quiz
XML Quizzes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizzes
JavaScript Quiz
VBScript Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizzes
ASP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
PL/SQL Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizzes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
VC++ Quiz
Multimedia Quizzes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building Quizzes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizzes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
JBOSS Quiz
Programming Langauges Quizzes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizzes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizzes
Oracle Quiz
MySQL Quiz
Operating System Quizzes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
MIDI Quiz
Software Testing Quizzes
Testing Quiz
Firewalls Quiz
SAP Module Quizzes
ERP Quiz
ABAP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizzes
Corba Quiz
Networking Quiz
Microsoft Office Quizzes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizzes
Financial Accounting Quiz
Managerial Accounting Quiz
Testimonials | Contact Us | Link to Us | Site Map
Copyright ? 2008. Academic Tutorials.com. All rights reserved Privacy Policies | About Us
Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | Discussions World | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Indian Free Ads | Jobs Assist | New Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Webhosting in India | Dedicated Server in India | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Testing Interview Questions | Tests World | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World | Important Websites
Copyright ? 2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved.