CSS Anshul
CSS Anshul
By:
R.Balaji (060341005)
Anshul Paul (060341008)
Contents
1. Introduction.
1.1 Definition : Style Sheet
1.2 Definition : Cascading Style Sheet
5. Evolution of CSS.
2.1 CSS1 Vs CSS2 Vs CSS3.
2.2 Adaptability.
4. Limitations of CSS.
Introduction
Style Sheet:
A Style Sheet is a single page of formatting instructions that can
control the appearance of many HTML pages.
CSS1 Text handling, including fonts, sizing, styles, and spacing. Back
ground and colors, margins, border and padding control of
objects , lists styles.
Mozilla's Gecko.
Opera's Presto layout engine.
Apple's Safari and KDE's Konqueror.
Internet Explorer 6.0.
CSS can also allow the same markup page to be presented in different styles
for different rendering methods, such as on-screen, in print, by voice.
Different users can have different style sheets for example a large text
alternative for visually-impaired users, or a layout optimized for small displays
for mobile phones.
The document code is reduced in size and complexity, since it does not need
to contain any presentational markup.
Types of CSS
An External Style Sheet is a plain text file containing file specifications for HTML tags
or classes, saved with the extension “.css”.
The HTML file that uses this style sheet file could reference it by using the <Link> tag
within the <Head> element of the document.
Style Sheets can be linked from any location.
Tip :
1. Always keep your style sheet in a central directory. (referenced using URL)
2. External style sheets are best approaches to use style sheets.(designer friendly and
bandwidth friendly)
Note:
Similarly like <LINK>, we can use @import to direct the web browser to load an
external style sheet. (@import should be placed within <STYLE>)
In embedded style sheets, the style rules has to be placed between the
<STYLE> and</STYLE> tags and it should be enclosed within the <HEAD>
and </HEAD> tags of HTML document.
The style information can be added to individual HTML elements using the
style attribute, which is available for several HTML elements.
If we want to apply the same style to multiple elements and also to apply more
than one style to an element or group of element…… a concept called
Grouping is used
This is the common way to apply styles with out worring about the elements
involved in the document
Class and ID Selectors continued….
Example :
Class selector :
<html>
<head><style>.tech{font-weight:bold;}</style>
<body>
<P class=“tech”>this uses the style rule</p>
<p>this doesn’t uses the rule</p>
</body></html>
ID Selector:
<html>
<head><style>#tech{font-weight:bold;}</style>
<body>
<P class=“tech”>this uses the style rule</p>
<p>this doesn’t uses the rule</p>
</body></html>
Limitations of CSS
Selectors are unable to ascend
CSS offers no way to select a parent or ancestor of element that
satisfies certain criteria
One block declaration cannot explicitly inherit from another
Absence of expressions
Lack of multiple backgrounds per element