SlideShare a Scribd company logo
Cascading style sheets (CSS)
-Varsha Kumari
9/9/2019 1
DHTML
• DHTML is the programming language that is
embedded in HTML and helps in creation of dynamic
web pages using a combination of the static markup
language HTML, a client side scripting language (such
as JavaScript) and the style definition language
Cascading Style Sheets.
• HTML specifies a web page’s elements like table,
frame, paragraph, list etc.
• CSS can be used for formatting some features of
those elements like element’s size, color, position
etc
9/9/2019 2
Introduction
What is CSS?
CSS stands for Cascading Style Sheets
Style sheet language
Describe the looks and formatting of a
document
Styles define how to display HTML elements
enable the separation of document content
from document presentation
9/9/2019 3
CSS Syntax
A CSS rule set consists of a selector and a
declaration block
Selector
points to the HTML element you want to style
Declaration
contains one or more declarations separated by
semicolons
includes a property name and a value, separated
by a colon
9/9/2019 4
CSS Syntax
9/9/2019 5
CSS Example
p {color: red; text-align: center; font-
size:30px; text-transform: uppercase;}
body {background-image: url(“gla.jpg");
margin-left:20px;}
td{background-color:”red” ;}
h2 { color: rgb(255,0,0); }
p { font-family: "Times New Roman“; } 6
• div {
border: 1px solid black;
margin: 100px 150px 100px 80px;
background-color: lightblue;
• }
9/9/2019 7
Three Ways to Insert CSS
Internal style sheet
Within the html document
External style sheet
As an external CSS file with .css extension
Inline style
In the same line where we want to apply the style
9/9/2019 8
Internal Style Sheet
Used when a single document has a unique
style
Defined in the head section of an HTML page
Defined within the <style> tag
Scope is up to the same document only
Every document has its own Internal CSS, if
required.
9/9/2019 9
abc.html
<html>
<head>
<style>
p {text-align: center; color: red;}
h1{color: red; text-transform: lowercase;}
</style>
</head>
<body>
<p>Every paragraph will be affected by the style.</p>
<h1Me too!</h1>
<p>And me!</p>
</body>
</html> Save it as “abc.html”
9/9/2019 10
External Style Sheet
 Ideal when the style is applied to many pages
 Changes the look of an entire Web site by
changing just one file
 Include a link to the style sheet with the
<link> tag
 <link> tag goes inside the head section
 Attributes of <link> tag:
rel
type
href
 CSS file is saved using .css extension
9/9/2019 11
External Style Sheet Example
H1 {color: red;}
H6{Color: green;}
Save it as “mystyle.css”
9/9/2019 12
External Style Sheet Example (Contd.)
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<h1> This is the biggest heading</h1>
<h6> This is the smallest heading</h6>
</body>
</html>
Save it as “abc.html”
9/9/2019 13
Inline Style Sheet
adds the style attribute to the relevant tag
style attribute can contain any CSS property
<p style="color:green;margin-left:20px; text-
transform: uppercase;” >
GLA University
</p>
Will work for only the specified tag at that line
only
9/9/2019 14
Cascading order
All the styles will "cascade" into a new
"virtual" style sheet by the following rules:
Inline style (inside an HTML element) (Highest
priority)
Internal style sheet (in the head section)
External style sheet
Browser default (Lowest priority)
9/9/2019 15
CSS Selectors
The element Selector
selects elements based on the element name
The id Selector
uses the id attribute of an HTML tag to find the specific
element
Hash (#) character, followed by the name of the id
The class Selector
finds elements with the specific class
uses the HTML class attribute
Period (.) character, followed by the name of the class
9/9/2019 16
Example of Element Selector
<html>
<head>
<style>
p {text-align: center; color: red;}
</style>
</head>
<body>
<p>Every paragraph will be affected by the style.</p>
<p id="para1">Me too!</p>
<p>And me!</p>
</body>
</html>
9/9/2019 17
Example of ID Selector
<html>
<head>
<style>
#para1 {text-align: center; color: red;}
</style>
</head>
<body>
<p id="para1">Hello World!</p>
<p>This paragraph is not affected by the style.</p>
</body>
</html>
9/9/2019 18
Another Example of ID Selector
<html>
<head>
<style>
p.center { text-align: center; color: red;}
</style>
</head>
<body>
<h1 class="center">This heading will not be affected</h1>
<p class="center">This paragraph will be red and center-
aligned.</p>
</body>
</html>
9/9/2019 19
Example of CLASS Selector
<html>
<head>
<style>
.center { text-align: center; color: red;}
</style>
</head>
<body>
<h1 class="center">Red and center-aligned heading</h1>
<p class="center">Red and center-aligned paragraph</p>
</body>
</html>
9/9/2019 20
Another Example of CLASS Selector
<html>
<head>
<style>
p.uppercase { text-transform: uppercase;}
p.lowercase { text-transform: lowercase;}
p.capitalize { text-transform: capitalize;}
</style>
</head>
<body>
<p class="uppercase">This is some text.</p>
<p class="lowercase">This is some text.</p>
<p class="capitalize">This is some text.</p>
</body>
</html>9/9/2019 21
Contextual Selectors:
• The SPAN element gives structure and context to any
inline content in a document.
<html><head>
<style type = “text/css”>
p {background-color: rgb(200,0,255)}
p.A {background-color: rgb(250,0,255)}
.B{background-color: rgb(0,133,0)}
</style></head>
<body>
<p> welcome to </p>
<p class="A">Welcome to <span class = "B"> GLA
University</span> Mathura.</p>
<p class="B">Uttar Pradesh</p>
</body></html>9/9/2019 22
Document Object Model(DOM):
• The components of web pages are represented by objects that are
organized in hierarchical structure(parent-child relationship), called
DOM
• These objects have properties and methods that can be used to
work with web pages.
• For a script to communicate one of the objects it must know the
path through the hierarchy to reach the object, so it can call one of
the methods or set one of its property values.
• Ex
• document.form1.firstname.value
• Document.bgcolor=“lightgreen”
• Document.title=“new title is my second web page”
• Document.write(“<h1>hello</h1>”);
9/9/2019 23
Example of DOM
9/9/2019 24
Browser Object Model
• The browser object model (BOM) is a hierarchy of
browser objects that are used to manipulate methods
and properties associated with the Web browser itself.
• BOM include the window object, navigator object,
screen object, history, location object, and the
document object.
• Top of the object hierarchy is the windows object.
• The Document Object consists of objects that are used
to manipulate methods and properties of the
document or Web page loaded in the browser window.
9/9/2019 25
9/9/2019 26
9/9/2019 27

More Related Content

What's hot

Css
CssCss
Chapter 6 html
Chapter 6 htmlChapter 6 html
Chapter 6 html
home
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
Sanjeev Kumar
 
HTML basics
HTML basicsHTML basics
HTML basics
Akhil Kaushik
 
Css
CssCss
3. tutorial html web desain
3. tutorial html web desain3. tutorial html web desain
3. tutorial html web desainfaizibra
 
HTML
HTMLHTML
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
eShikshak
 
HTML Tutorials
HTML TutorialsHTML Tutorials
HTML Tutorials
Arvind Kumar
 
Web Page Designing Using HTML
Web Page Designing Using HTMLWeb Page Designing Using HTML
Web Page Designing Using HTML
Arunima Education Foundation
 
HTML By K.Sasidhar
HTML By K.SasidharHTML By K.Sasidhar
HTML By K.Sasidhar
Sasidhar Kothuru
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
Programmer Blog
 
Html project
Html projectHtml project
Html projectarsh7511
 
Web Application and HTML Summary
Web Application and HTML SummaryWeb Application and HTML Summary
Web Application and HTML Summary
Fernando Torres
 
Web development using html 5
Web development using html 5Web development using html 5
Web development using html 5
Anjan Mahanta
 
Elements of html powerpoint
Elements of html powerpointElements of html powerpoint
Elements of html powerpoint
Anastasia1993
 

What's hot (19)

Css
CssCss
Css
 
Chapter 6 html
Chapter 6 htmlChapter 6 html
Chapter 6 html
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
HTML basics
HTML basicsHTML basics
HTML basics
 
Css
CssCss
Css
 
3. tutorial html web desain
3. tutorial html web desain3. tutorial html web desain
3. tutorial html web desain
 
CSS - LinkedIn
CSS - LinkedInCSS - LinkedIn
CSS - LinkedIn
 
HTML
HTMLHTML
HTML
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Html
HtmlHtml
Html
 
HTML Tutorials
HTML TutorialsHTML Tutorials
HTML Tutorials
 
Web Page Designing Using HTML
Web Page Designing Using HTMLWeb Page Designing Using HTML
Web Page Designing Using HTML
 
HTML By K.Sasidhar
HTML By K.SasidharHTML By K.Sasidhar
HTML By K.Sasidhar
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
Html project
Html projectHtml project
Html project
 
Web Application and HTML Summary
Web Application and HTML SummaryWeb Application and HTML Summary
Web Application and HTML Summary
 
Web development using html 5
Web development using html 5Web development using html 5
Web development using html 5
 
Elements of html powerpoint
Elements of html powerpointElements of html powerpoint
Elements of html powerpoint
 

Similar to Css module1

Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Folasade Adedeji
 
CSS notes
CSS notesCSS notes
CSS notes
Rajendra Prasad
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
kassahungebrie
 
Using Cascading Style Sheets2
Using Cascading Style Sheets2Using Cascading Style Sheets2
Using Cascading Style Sheets2Sutinder Mann
 
Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10Sutinder Mann
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Mukesh Tekwani
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
Vladimir Valencia
 
cse labpractical.ppt
cse labpractical.pptcse labpractical.ppt
cse labpractical.ppt
NividitaDarwai
 
Css starting
Css startingCss starting
Css starting
Rahul Dihora
 
CSS (Cascading Style Sheet)
CSS (Cascading Style Sheet)CSS (Cascading Style Sheet)
CSS (Cascading Style Sheet)
Harshit Srivastava
 
Css introduction
Css introductionCss introduction
Css introductionSridhar P
 
Cascading style-sheet-
Cascading style-sheet-Cascading style-sheet-
Cascading style-sheet-
Nimrakhan89
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssTesfaye Yenealem
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to cssBulldogs83
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to cssBulldogs83
 
HTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptxHTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptx
JJFajardo1
 

Similar to Css module1 (20)

Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
CSS notes
CSS notesCSS notes
CSS notes
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
 
Turorial css
Turorial cssTurorial css
Turorial css
 
Using Cascading Style Sheets2
Using Cascading Style Sheets2Using Cascading Style Sheets2
Using Cascading Style Sheets2
 
Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10Using Templates And Cascading Style Sheets10
Using Templates And Cascading Style Sheets10
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
cse labpractical.ppt
cse labpractical.pptcse labpractical.ppt
cse labpractical.ppt
 
Css starting
Css startingCss starting
Css starting
 
Web Designing
Web DesigningWeb Designing
Web Designing
 
CSS (Cascading Style Sheet)
CSS (Cascading Style Sheet)CSS (Cascading Style Sheet)
CSS (Cascading Style Sheet)
 
Css introduction
Css introductionCss introduction
Css introduction
 
Cascading style-sheet-
Cascading style-sheet-Cascading style-sheet-
Cascading style-sheet-
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to css
 
3.2 introduction to css
3.2 introduction to css3.2 introduction to css
3.2 introduction to css
 
HTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptxHTML to CSS Basics Exer 2.pptx
HTML to CSS Basics Exer 2.pptx
 

More from VARSHAKUMARI49

28,29. procedures subprocedure,type checking functions in VBScript
28,29. procedures  subprocedure,type checking functions in VBScript28,29. procedures  subprocedure,type checking functions in VBScript
28,29. procedures subprocedure,type checking functions in VBScript
VARSHAKUMARI49
 
30,31,32,33. decision and loop statements in vbscript
30,31,32,33. decision and loop statements in vbscript30,31,32,33. decision and loop statements in vbscript
30,31,32,33. decision and loop statements in vbscript
VARSHAKUMARI49
 
27. mathematical, date and time functions in VB Script
27. mathematical, date and time  functions in VB Script27. mathematical, date and time  functions in VB Script
27. mathematical, date and time functions in VB Script
VARSHAKUMARI49
 
Introduction to web technology
Introduction to web technologyIntroduction to web technology
Introduction to web technology
VARSHAKUMARI49
 
Database normalization
Database normalizationDatabase normalization
Database normalization
VARSHAKUMARI49
 
Joins
JoinsJoins
Sub queries
Sub queriesSub queries
Sub queries
VARSHAKUMARI49
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
VARSHAKUMARI49
 
Vbscript
VbscriptVbscript
Vbscript
VARSHAKUMARI49
 
Js mod1
Js mod1Js mod1
Register counters.readonly
Register counters.readonlyRegister counters.readonly
Register counters.readonly
VARSHAKUMARI49
 
Sorting.ppt read only
Sorting.ppt read onlySorting.ppt read only
Sorting.ppt read only
VARSHAKUMARI49
 
Hashing
HashingHashing

More from VARSHAKUMARI49 (13)

28,29. procedures subprocedure,type checking functions in VBScript
28,29. procedures  subprocedure,type checking functions in VBScript28,29. procedures  subprocedure,type checking functions in VBScript
28,29. procedures subprocedure,type checking functions in VBScript
 
30,31,32,33. decision and loop statements in vbscript
30,31,32,33. decision and loop statements in vbscript30,31,32,33. decision and loop statements in vbscript
30,31,32,33. decision and loop statements in vbscript
 
27. mathematical, date and time functions in VB Script
27. mathematical, date and time  functions in VB Script27. mathematical, date and time  functions in VB Script
27. mathematical, date and time functions in VB Script
 
Introduction to web technology
Introduction to web technologyIntroduction to web technology
Introduction to web technology
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Joins
JoinsJoins
Joins
 
Sub queries
Sub queriesSub queries
Sub queries
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
Vbscript
VbscriptVbscript
Vbscript
 
Js mod1
Js mod1Js mod1
Js mod1
 
Register counters.readonly
Register counters.readonlyRegister counters.readonly
Register counters.readonly
 
Sorting.ppt read only
Sorting.ppt read onlySorting.ppt read only
Sorting.ppt read only
 
Hashing
HashingHashing
Hashing
 

Recently uploaded

ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 

Recently uploaded (20)

ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 

Css module1

  • 1. Cascading style sheets (CSS) -Varsha Kumari 9/9/2019 1
  • 2. DHTML • DHTML is the programming language that is embedded in HTML and helps in creation of dynamic web pages using a combination of the static markup language HTML, a client side scripting language (such as JavaScript) and the style definition language Cascading Style Sheets. • HTML specifies a web page’s elements like table, frame, paragraph, list etc. • CSS can be used for formatting some features of those elements like element’s size, color, position etc 9/9/2019 2
  • 3. Introduction What is CSS? CSS stands for Cascading Style Sheets Style sheet language Describe the looks and formatting of a document Styles define how to display HTML elements enable the separation of document content from document presentation 9/9/2019 3
  • 4. CSS Syntax A CSS rule set consists of a selector and a declaration block Selector points to the HTML element you want to style Declaration contains one or more declarations separated by semicolons includes a property name and a value, separated by a colon 9/9/2019 4
  • 6. CSS Example p {color: red; text-align: center; font- size:30px; text-transform: uppercase;} body {background-image: url(“gla.jpg"); margin-left:20px;} td{background-color:”red” ;} h2 { color: rgb(255,0,0); } p { font-family: "Times New Roman“; } 6
  • 7. • div { border: 1px solid black; margin: 100px 150px 100px 80px; background-color: lightblue; • } 9/9/2019 7
  • 8. Three Ways to Insert CSS Internal style sheet Within the html document External style sheet As an external CSS file with .css extension Inline style In the same line where we want to apply the style 9/9/2019 8
  • 9. Internal Style Sheet Used when a single document has a unique style Defined in the head section of an HTML page Defined within the <style> tag Scope is up to the same document only Every document has its own Internal CSS, if required. 9/9/2019 9
  • 10. abc.html <html> <head> <style> p {text-align: center; color: red;} h1{color: red; text-transform: lowercase;} </style> </head> <body> <p>Every paragraph will be affected by the style.</p> <h1Me too!</h1> <p>And me!</p> </body> </html> Save it as “abc.html” 9/9/2019 10
  • 11. External Style Sheet  Ideal when the style is applied to many pages  Changes the look of an entire Web site by changing just one file  Include a link to the style sheet with the <link> tag  <link> tag goes inside the head section  Attributes of <link> tag: rel type href  CSS file is saved using .css extension 9/9/2019 11
  • 12. External Style Sheet Example H1 {color: red;} H6{Color: green;} Save it as “mystyle.css” 9/9/2019 12
  • 13. External Style Sheet Example (Contd.) <html> <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> <body> <h1> This is the biggest heading</h1> <h6> This is the smallest heading</h6> </body> </html> Save it as “abc.html” 9/9/2019 13
  • 14. Inline Style Sheet adds the style attribute to the relevant tag style attribute can contain any CSS property <p style="color:green;margin-left:20px; text- transform: uppercase;” > GLA University </p> Will work for only the specified tag at that line only 9/9/2019 14
  • 15. Cascading order All the styles will "cascade" into a new "virtual" style sheet by the following rules: Inline style (inside an HTML element) (Highest priority) Internal style sheet (in the head section) External style sheet Browser default (Lowest priority) 9/9/2019 15
  • 16. CSS Selectors The element Selector selects elements based on the element name The id Selector uses the id attribute of an HTML tag to find the specific element Hash (#) character, followed by the name of the id The class Selector finds elements with the specific class uses the HTML class attribute Period (.) character, followed by the name of the class 9/9/2019 16
  • 17. Example of Element Selector <html> <head> <style> p {text-align: center; color: red;} </style> </head> <body> <p>Every paragraph will be affected by the style.</p> <p id="para1">Me too!</p> <p>And me!</p> </body> </html> 9/9/2019 17
  • 18. Example of ID Selector <html> <head> <style> #para1 {text-align: center; color: red;} </style> </head> <body> <p id="para1">Hello World!</p> <p>This paragraph is not affected by the style.</p> </body> </html> 9/9/2019 18
  • 19. Another Example of ID Selector <html> <head> <style> p.center { text-align: center; color: red;} </style> </head> <body> <h1 class="center">This heading will not be affected</h1> <p class="center">This paragraph will be red and center- aligned.</p> </body> </html> 9/9/2019 19
  • 20. Example of CLASS Selector <html> <head> <style> .center { text-align: center; color: red;} </style> </head> <body> <h1 class="center">Red and center-aligned heading</h1> <p class="center">Red and center-aligned paragraph</p> </body> </html> 9/9/2019 20
  • 21. Another Example of CLASS Selector <html> <head> <style> p.uppercase { text-transform: uppercase;} p.lowercase { text-transform: lowercase;} p.capitalize { text-transform: capitalize;} </style> </head> <body> <p class="uppercase">This is some text.</p> <p class="lowercase">This is some text.</p> <p class="capitalize">This is some text.</p> </body> </html>9/9/2019 21
  • 22. Contextual Selectors: • The SPAN element gives structure and context to any inline content in a document. <html><head> <style type = “text/css”> p {background-color: rgb(200,0,255)} p.A {background-color: rgb(250,0,255)} .B{background-color: rgb(0,133,0)} </style></head> <body> <p> welcome to </p> <p class="A">Welcome to <span class = "B"> GLA University</span> Mathura.</p> <p class="B">Uttar Pradesh</p> </body></html>9/9/2019 22
  • 23. Document Object Model(DOM): • The components of web pages are represented by objects that are organized in hierarchical structure(parent-child relationship), called DOM • These objects have properties and methods that can be used to work with web pages. • For a script to communicate one of the objects it must know the path through the hierarchy to reach the object, so it can call one of the methods or set one of its property values. • Ex • document.form1.firstname.value • Document.bgcolor=“lightgreen” • Document.title=“new title is my second web page” • Document.write(“<h1>hello</h1>”); 9/9/2019 23
  • 25. Browser Object Model • The browser object model (BOM) is a hierarchy of browser objects that are used to manipulate methods and properties associated with the Web browser itself. • BOM include the window object, navigator object, screen object, history, location object, and the document object. • Top of the object hierarchy is the windows object. • The Document Object consists of objects that are used to manipulate methods and properties of the document or Web page loaded in the browser window. 9/9/2019 25