SlideShare a Scribd company logo
COMPUTER APPLICATIONS
CLASS X (Code 165)
TOPIC:
UNIT 2: Cascading Style Sheets
An Introduction
By
HIMANSHU PATHAK
Contents
• Introduction
• Need for CSS
• CSS Syntax
• CSS Selectors
• Types of CSS
– Inline CSS
– Internal/Embedded CSS
– External CSS
Introduction
• CSS is the language we use to style the webpage.
• CSS stands for Cascading Style Sheets.
• Now let’s try to break the acronym:
– Cascading: Falling of Styles
– Style: Adding designs/Styling our HTML tags
– Sheets: Writing our style in different documents
• CSS saves a lot of work. It can control the layout of
multiple web pages all at once.
• HTML, CSS and JavaScript are used for web
designing. It helps the web designers to apply style
on HTML tags.
Why CSS?
• CSS saves time: We can write CSS once and reuse
the same sheet in multiple HTML pages.
• Easy maintenance: To make a global change
simply change the style, and all elements in all
the webpages will be updated automatically.
• Page load faster: Just write one CSS rule of a tag
and apply it to all the occurrences of that tag. So
less code means faster download times.
CSS Syntax
• A CSS Syntax rule consists of a selector, property,
and its value.
• The selector points to the HTML element where
CSS style is to be applied.
• The CSS property is separated by semicolons.
• It is a combination of selector name followed by
the property: value pair that is defined for the
specific selector.
• Selector -- h1
• Declaration -- {color : blue; font-size : 12px;}
CSS Selectors
• CSS selectors are used to "find" (or select) the
HTML elements you want to style.
• CSS selectors select HTML elements according to
its id, class, type, attribute etc.
• There are many basic different types of selectors:
– Element Selector
– Id Selector
– Class Selector
Element Selector
• The element selector selects HTML elements
based on the element name.
• Example:
p {
text-align: center;
color: red;
}
ID Selector
• The id selector uses the id attribute of an HTML
element to select a specific element.
• The id of an element is unique within a page, so the
id selector is used to select one unique element.
• To select an element with a specific id, write a hash
(#) character, followed by the id of the element.
• Example:
#para1 {
text-align: center;
color: blue;
}
Class Selector
• The class selector selects HTML elements with a
specific class attribute.
• To select elements with a specific class, write a
period (.) character, followed by the class name.
• Example:
.heading {
color: green;
text-align: center;
font-size: 40px;
}
Types of CSS
• Cascading Style Sheet(CSS) is used to set the style in
web pages that contain HTML elements.
• Here "CSS types" means writing the CSS style in the
HTML document, where should it be placed on the
document? And what are the different ways to use
CSS styles?
• CSS can be added to HTML documents in 3 ways:
– Inline - by using the style attribute inside HTML elements
– Internal - by using a <style> element in
the <head> section
– External - by using a <link> element to link to an external
CSS file.
Inline CSS
• An inline CSS is used to apply a unique style to a
single HTML element.
• Managing a website may difficult if we use
only inline CSS.
• So, Whenever our requirements are very small
we can use inline CSS.
• Example:
– <p style="color : red;">This is In-line CSS .</p>
Internal CSS
• An internal CSS is used to define a style for a single
HTML page.
• The CSS rule set should be within the HTML file in
the head section i.e the CSS is embedded within the
HTML file.
• Example:
– <style>
body {background-color: yellow;}
h1 {color: blue;}
p {color: red;}
</style>
External CSS
• An external style sheet is used to define the
style for many HTML pages.
• In External CSS we create a .css file and use it in
our HTML page as per our requirements.
• The CSS is more efficient method for styling a
website. By editing the .css file, we can change
the whole site at once.
Cont…
HTML FILE
<html>
<head>
<link rel="stylesheet"
href=“styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
CSS FILE
body {
background-color: yellow;
}
h1 {
color: blue;
}
p {
color: red;
}
Summary
• CSS Syntax
• CSS Selector
• Types of CSS
• In the next class, we will start Unit II – Cascading
Style Sheet : Part 2 in detail.
•Thanks

More Related Content

What's hot

Cascading style sheet (css)]
Cascading style sheet (css)]Cascading style sheet (css)]
Cascading style sheet (css)]
9574395990
 
Introducing Cascading Style Sheets
Introducing Cascading Style SheetsIntroducing Cascading Style Sheets
Introducing Cascading Style Sheets
St. Petersburg College
 
Css how to insert css
Css how to insert cssCss how to insert css
Css how to insert css
Sumit Rana
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Marc Steel
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
apnwebdev
 
Web Development - Lecture 5
Web Development - Lecture 5Web Development - Lecture 5
Web Development - Lecture 5
Syed Shahzaib Sohail
 
Web programming css
Web programming cssWeb programming css
Web programming css
Uma mohan
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
AakankshaR
 
Week11 Lecture: CSS
Week11 Lecture: CSSWeek11 Lecture: CSS
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
Harshita Yadav
 
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
Syed Shahzaib Sohail
 
Css1
Css1Css1
CSS 101
CSS 101CSS 101
CSS 101
dunclair
 
Css
CssCss
Css
CssCss
Casc Style Sheets Ii
Casc Style Sheets IiCasc Style Sheets Ii
Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)
Harshil Darji
 
Web Development - Lecture 3
Web Development - Lecture 3Web Development - Lecture 3
Web Development - Lecture 3
Syed Shahzaib Sohail
 

What's hot (19)

Cascading style sheet (css)]
Cascading style sheet (css)]Cascading style sheet (css)]
Cascading style sheet (css)]
 
Introducing Cascading Style Sheets
Introducing Cascading Style SheetsIntroducing Cascading Style Sheets
Introducing Cascading Style Sheets
 
Css how to insert css
Css how to insert cssCss how to insert css
Css how to insert css
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Web Development - Lecture 5
Web Development - Lecture 5Web Development - Lecture 5
Web Development - Lecture 5
 
Web programming css
Web programming cssWeb programming css
Web programming css
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Week11 Lecture: CSS
Week11 Lecture: CSSWeek11 Lecture: CSS
Week11 Lecture: CSS
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
 
Css1
Css1Css1
Css1
 
CSS 101
CSS 101CSS 101
CSS 101
 
Css
CssCss
Css
 
Css
CssCss
Css
 
Casc Style Sheets Ii
Casc Style Sheets IiCasc Style Sheets Ii
Casc Style Sheets Ii
 
Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)
 
Web Development - Lecture 3
Web Development - Lecture 3Web Development - Lecture 3
Web Development - Lecture 3
 

Similar to Cascading style sheet an introduction

Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
JebaRaj26
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
Sónia
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
Webtech Learning
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptx
karthiksmart21
 
Css
CssCss
CSS Introduction
CSS Introduction CSS Introduction
CSS Introduction
Thapar Institute
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptx
MattMarino13
 
css.ppt
css.pptcss.ppt
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdf
elayelily
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptx
alvindalejoyosa1
 
Unit 2 WT-CSS.pptx web technology project
Unit 2 WT-CSS.pptx web technology projectUnit 2 WT-CSS.pptx web technology project
Unit 2 WT-CSS.pptx web technology project
abhiramhatwar
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
Hawkman Academy
 
Css.html
Css.htmlCss.html
chitra
chitrachitra
chitra
sweet chitra
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
MattMarino13
 
Css
CssCss
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
MattMarino13
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Erin M. Kidwell
 
DHTML
DHTMLDHTML
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
smithaps4
 

Similar to Cascading style sheet an introduction (20)

Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptx
 
Css
CssCss
Css
 
CSS Introduction
CSS Introduction CSS Introduction
CSS Introduction
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptx
 
css.ppt
css.pptcss.ppt
css.ppt
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdf
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptx
 
Unit 2 WT-CSS.pptx web technology project
Unit 2 WT-CSS.pptx web technology projectUnit 2 WT-CSS.pptx web technology project
Unit 2 WT-CSS.pptx web technology project
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
 
Css.html
Css.htmlCss.html
Css.html
 
chitra
chitrachitra
chitra
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
 
Css
CssCss
Css
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
 
DHTML
DHTMLDHTML
DHTML
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 

More from Himanshu Pathak

Introduction to E commerce
Introduction to E commerceIntroduction to E commerce
Introduction to E commerce
Himanshu Pathak
 
Digital property rights
Digital property rightsDigital property rights
Digital property rights
Himanshu Pathak
 
Intellectual property rights
Intellectual property rightsIntellectual property rights
Intellectual property rights
Himanshu Pathak
 
An Introduction to Cyber Ethics
An Introduction to Cyber EthicsAn Introduction to Cyber Ethics
An Introduction to Cyber Ethics
Himanshu Pathak
 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2
Himanshu Pathak
 
Html multimedia
Html multimediaHtml multimedia
Html multimedia
Himanshu Pathak
 
Html forms
Html formsHtml forms
Html forms
Himanshu Pathak
 
Html tables
Html tablesHtml tables
Html tables
Himanshu Pathak
 
Html link and list tags
Html link and list tagsHtml link and list tags
Html link and list tags
Himanshu Pathak
 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tags
Himanshu Pathak
 
Basic html tags
Basic html tagsBasic html tags
Basic html tags
Himanshu Pathak
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
Himanshu Pathak
 
Mobile technologies
Mobile technologiesMobile technologies
Mobile technologies
Himanshu Pathak
 
Web services
Web servicesWeb services
Web services
Himanshu Pathak
 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer Protocols
Himanshu Pathak
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
Himanshu Pathak
 
Introduction to internet
Introduction to internetIntroduction to internet
Introduction to internet
Himanshu Pathak
 
What is Computer?
What is Computer?What is Computer?
What is Computer?
Himanshu Pathak
 

More from Himanshu Pathak (18)

Introduction to E commerce
Introduction to E commerceIntroduction to E commerce
Introduction to E commerce
 
Digital property rights
Digital property rightsDigital property rights
Digital property rights
 
Intellectual property rights
Intellectual property rightsIntellectual property rights
Intellectual property rights
 
An Introduction to Cyber Ethics
An Introduction to Cyber EthicsAn Introduction to Cyber Ethics
An Introduction to Cyber Ethics
 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2
 
Html multimedia
Html multimediaHtml multimedia
Html multimedia
 
Html forms
Html formsHtml forms
Html forms
 
Html tables
Html tablesHtml tables
Html tables
 
Html link and list tags
Html link and list tagsHtml link and list tags
Html link and list tags
 
HTML Text formatting tags
HTML Text formatting tagsHTML Text formatting tags
HTML Text formatting tags
 
Basic html tags
Basic html tagsBasic html tags
Basic html tags
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Mobile technologies
Mobile technologiesMobile technologies
Mobile technologies
 
Web services
Web servicesWeb services
Web services
 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer Protocols
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
 
Introduction to internet
Introduction to internetIntroduction to internet
Introduction to internet
 
What is Computer?
What is Computer?What is Computer?
What is Computer?
 

Recently uploaded

The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
spdendr
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 

Recently uploaded (20)

The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 

Cascading style sheet an introduction

  • 1. COMPUTER APPLICATIONS CLASS X (Code 165) TOPIC: UNIT 2: Cascading Style Sheets An Introduction By HIMANSHU PATHAK
  • 2. Contents • Introduction • Need for CSS • CSS Syntax • CSS Selectors • Types of CSS – Inline CSS – Internal/Embedded CSS – External CSS
  • 3. Introduction • CSS is the language we use to style the webpage. • CSS stands for Cascading Style Sheets. • Now let’s try to break the acronym: – Cascading: Falling of Styles – Style: Adding designs/Styling our HTML tags – Sheets: Writing our style in different documents • CSS saves a lot of work. It can control the layout of multiple web pages all at once. • HTML, CSS and JavaScript are used for web designing. It helps the web designers to apply style on HTML tags.
  • 4. Why CSS? • CSS saves time: We can write CSS once and reuse the same sheet in multiple HTML pages. • Easy maintenance: To make a global change simply change the style, and all elements in all the webpages will be updated automatically. • Page load faster: Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means faster download times.
  • 5. CSS Syntax • A CSS Syntax rule consists of a selector, property, and its value. • The selector points to the HTML element where CSS style is to be applied. • The CSS property is separated by semicolons. • It is a combination of selector name followed by the property: value pair that is defined for the specific selector. • Selector -- h1 • Declaration -- {color : blue; font-size : 12px;}
  • 6. CSS Selectors • CSS selectors are used to "find" (or select) the HTML elements you want to style. • CSS selectors select HTML elements according to its id, class, type, attribute etc. • There are many basic different types of selectors: – Element Selector – Id Selector – Class Selector
  • 7. Element Selector • The element selector selects HTML elements based on the element name. • Example: p { text-align: center; color: red; }
  • 8. ID Selector • The id selector uses the id attribute of an HTML element to select a specific element. • The id of an element is unique within a page, so the id selector is used to select one unique element. • To select an element with a specific id, write a hash (#) character, followed by the id of the element. • Example: #para1 { text-align: center; color: blue; }
  • 9. Class Selector • The class selector selects HTML elements with a specific class attribute. • To select elements with a specific class, write a period (.) character, followed by the class name. • Example: .heading { color: green; text-align: center; font-size: 40px; }
  • 10. Types of CSS • Cascading Style Sheet(CSS) is used to set the style in web pages that contain HTML elements. • Here "CSS types" means writing the CSS style in the HTML document, where should it be placed on the document? And what are the different ways to use CSS styles? • CSS can be added to HTML documents in 3 ways: – Inline - by using the style attribute inside HTML elements – Internal - by using a <style> element in the <head> section – External - by using a <link> element to link to an external CSS file.
  • 11. Inline CSS • An inline CSS is used to apply a unique style to a single HTML element. • Managing a website may difficult if we use only inline CSS. • So, Whenever our requirements are very small we can use inline CSS. • Example: – <p style="color : red;">This is In-line CSS .</p>
  • 12. Internal CSS • An internal CSS is used to define a style for a single HTML page. • The CSS rule set should be within the HTML file in the head section i.e the CSS is embedded within the HTML file. • Example: – <style> body {background-color: yellow;} h1 {color: blue;} p {color: red;} </style>
  • 13. External CSS • An external style sheet is used to define the style for many HTML pages. • In External CSS we create a .css file and use it in our HTML page as per our requirements. • The CSS is more efficient method for styling a website. By editing the .css file, we can change the whole site at once.
  • 14. Cont… HTML FILE <html> <head> <link rel="stylesheet" href=“styles.css"> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> </body> </html> CSS FILE body { background-color: yellow; } h1 { color: blue; } p { color: red; }
  • 15. Summary • CSS Syntax • CSS Selector • Types of CSS • In the next class, we will start Unit II – Cascading Style Sheet : Part 2 in detail. •Thanks