0% found this document useful (0 votes)
93 views

CSS Sayandeb

This presentation introduces Cascading Style Sheets (CSS) which separates document presentation from its content. CSS allows multiple style sheets to apply to a web page. There are author, user, and user agent styles. External style sheets are ideal for many pages while embedded and inline styles are for single documents or elements. CSS advantages include centralized presentation, customization for users, and simpler code. However, older browsers may not support all CSS2 properties and can misinterpret some.

Uploaded by

api-3706009
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views

CSS Sayandeb

This presentation introduces Cascading Style Sheets (CSS) which separates document presentation from its content. CSS allows multiple style sheets to apply to a web page. There are author, user, and user agent styles. External style sheets are ideal for many pages while embedded and inline styles are for single documents or elements. CSS advantages include centralized presentation, customization for users, and simpler code. However, older browsers may not support all CSS2 properties and can misinterpret some.

Uploaded by

api-3706009
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 10

Presentation

on
Cascading Style Sheets
by
Sayandeb Pal
Introduction
• CSS is used by both the authors and readers of web pages
to define colors, fonts, layout, and other aspects of
document presentation. It is designed primarily to enable
the separation of document content (written in HTML /
XHTML / XML) from document presentation (written in
CSS) to improve content accessibility, provide more
flexibility and control in the specification of presentational
characteristics, and reduce complexity and repetition in the
structural content.

• The term cascading derives from the fact that multiple style
sheets can be applied to the same Web page.
Types of CSS
• Author styles (style information provided by the web page author)
– external stylesheets, i.e. a separate CSS-file referenced from the
document
– embedded style, blocks of CSS information inside the HTML
document itself
– inline styles, inside the HTML document, style information on a
single element, specified using the "style" attribute.

• User style
– a local CSS-file specified by the user using options in the web
browser, and acting as an override, to be applied to all
documents.

• User agent style


– the default style sheet applied by the user agent, e.g. the
browser's default presentation of elements.
External Style Sheets

• An external style sheet is ideal when the style is applied


to many pages.

• The file should not contain any html tags.

• The style sheet should be saved with a .css extension,


for example style.css
• Example of external style sheet file style.css:

hr {color: sienna}
p {margin-left: 20px}
body {background-image: url("images/back40.gif")}

• The <link> tag for the HTML pages :

<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
Embedded Style Sheets
• An embedded style sheet should be used when a single
document has a unique style.

• Example of embedded style sheet :

<head>
<style type="text/css">
body { background: #fff; color: #000; }
h1, h2 { font-style: italic; font-weight: bold; color: blue; }
</style>
</head>
Inline Style Sheets

• Inline style sheets are used when a style is to be applied to a


single occurrence of an element.

• Example of inline style sheet :

<h1 style="color: red; font-style: italic">


This is a header
</h1>
Advantages of CSS

• Presentation information for an entire website or collection of


pages can be held in one place, and can be updated quickly
and easily.

• Different users can have different style sheets.

• The document code is reduced in size and complexity.


Adaptation Limitation

• Microsoft Internet Explorer, version 6 lacks support for about


30 percent of CSS2 properties.

• Misinterpretation of a number of important properties, such as


"width", "height", and "float".
Thank You

You might also like