You are on page 1of 15

Cascading Style Sheets (CSS)

Presented By :
Aakriti Aganja (KCE074BCT03)
Chiranjivi Upadhyaya (KCE074BCT017)
Oshin Gansi (KCE074BCT30)
Sujata Suwal (KCE074BCT43)
Topic to cover

1.Introduction

2.CSS Syntax

3.Applying CSS

4.Advantages
Introduction

1.CSS was first proposed by Håkon Wium Lie on 1994 and


recommended by World Wide Web Consortium W3C in 1996.

2.It is a style sheet language and not a programming language.


CSS Versions
CSS Structure

A CSS rule is made up of selector and a declaration.

A decleration consists of property and value

Example:
Selectors

A selector is often an HTML element.

Here, in green colour.

h1{ property , value;}

p {property , value;}

body{property , value;}
Properties and value

h1{ color , blue;}

p {font-size , large;}

body{background , white;}
Grouping Selectors
Group the same selector with different declerations together on one line.

h1{ color , red;}

h1{ font-weight , bold;}

h1{ background , white;}

Selector h1 can be written as:

h1{ color , red;

font-wodth , bold;

background , white

}
Applying CSS
An inline style may be used to apply a unique style for a single element.

An inline is implemented in the same HTML line.

An internal CSS is used to define a style for a single HTML page.

An internal CSS is defined in the <head> section of an HTML page, within a <style> element.

The external CSS is generally used when you want to make changes on multiple pages.

It uses the <link> tag on every pages and the <link> tag should be put inside the head
section.
Typical Web Page HTML

● Typical HTML web page is made up of containers or div.


● Each div is assigned an ID or a class.
Typical web page CSS

The CSS file uses same div id/class as the HTML and uses them to style the
element.

#container {property, value;}

#menu {property, value;}

#main {property, value;}

#footer {property, value;}


ID and Classes
ID (#) are unique and can only be used once.

Classes(.) can be used as many times as needed.

HTML Code:

<h1 id="heading">Name</h1>

<p class= "name">Ram</p>

CSS Code:

#heading{ color: green}

.name{color: red}
Advantages of CSS

1. Easier to maintain and update


2. Greater consistency in design
3. More formatting options
4. Lightweight code
5. Faster download times
6. Search engine optimization benefits
7. Ease of presenting different styles to different viewers
8. Greater accessibility
Thank You!

You might also like