SlideShare a Scribd company logo
2
Most read
4
Most read
5
Most read
Web Programming and
Design
CSS (Cascading Style Sheet)
By : Gheyath M. Othman
Introduction to CSS (Cascading Style Sheet)
2
What is CSS ?
• CSS stands for Cascading Style Sheets
• CSS describes how HTML elements are to be displayed on screen, paper,
or in other media
• CSS saves a lot of work. It can control the layout of multiple web pages
all at once
• External style sheets are stored in CSS files
Introduction to CSS (Cascading Style Sheet)
3
Som advantages of CSS:
• Save time
• Load page faster
• Easy maintenance
• Superior(larger) styles to HTML
• Multiple device compatibility
• Global web standards
Introduction to CSS (Cascading Style Sheet)
4
Who Creates and Maintains CSS?
CSS is created and maintained through a group of people within the W3C
called the CSS Working Group. The CSS Working Group creates documents
called specifications. When a specification has been discussed and officially
ratified by W3C members, it becomes a recommendation.
NOTE: The World Wide Web Consortium, or W3C is a group that makes recommendations
about how the Internet works and how it should evolve.
CSS Syntax
5
A CSS rule set consists of a selector and a declaration block.
• The selector points to the HTML element you want to style
• The declaration block contains one or more declarations separated by
semicolons.
• Each declaration includes a property name and a value assigned to
property, separated by a colon.
In the following example all <p> elements will be center-aligned, with a red text
color:
<!DOCTYPE html>
<html>
<head>
<style>
p {
color: red;
text-align: center;
}
</style>
</head>
<body>
<p>Hello World!</p>
<p>This paragraph is styled with CSS.</p>
</body></html>
e1_first-ex>>
CSS Syntax
6
NOTE: To make the CSS code more readable,
you can put one declaration on each line.
• CSS selectors allow you to select and manipulate HTML elements.
• CSS selectors are used to "find" (or select) HTML elements based on their
id, class, type, attributes and more.
CSS Selectors
7
Element Selector:
▪ Element selector selects elements based on the element name. You can
select all <p> elements on a page like this: e2_element-selector>>
CSS Element Selector
8
<!DOCTYPE html><html>
<head>
<style>
p {
text-align: center;
color: red;
}
</style>
</head>
<body>
<p>All paragraphs will be affected </p>
<p id="para1">Me too!</p>
<p>And me!</p>
</body>
</html>
id Selectors:
▪ The id selector uses the id attribute of an HTML element to select a specific
element.
▪ An id should be unique within a page, so the id selector is used if you want to
select a single, unique element.
▪ Use a hash character followed by the id element. “#id_name” LIKE:
#red {
text-align: center;
color: red;
}
CSS id Selector
9
NOTE: ID name must not start with a number!.
Also as pointed that id should be unique because java script is care about that..
id Selector example:
CSS id Selector
10
<!DOCTYPE html>
<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>
e3_id-selector>>
class Selectors:
▪ The class selector selects elements with a specific class attribute.
▪ Unlike id selector, classes are not unique, so the same class can be used for
multiple elements.
▪ Use a period character(.) followed by the class name. “.class_name” LIKE:
.center {
text-align: center;
color: red;
}
▪ You can also specify that only specific HTML elements should be affected by
a class. p.center {
text-align: center;
color: red;
}
CSS Class Selector
11NOTE: CLASS name must not start with a number!
class selector example: e4_class-selector>> e5_class-selector1>>
CSS Class Selector
12
<!DOCTYPE html><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>
<!DOCTYPE html><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>
CSS Universal Selector
13
The universal selector is an asterisk; it is like a wildcard and matches all element
types in the document.
*{CSS code..}
If you want a rule to apply to all elements, you can use this selector. Sometimes it
is used for default values that will apply to the whole of the document (such as a
font - family and font - size ) unless another more specific selector indicates that
an element should use different values for these same properties.
<!DOCTYPE html><html><head>
<style type="text/css">
*{ color: red; font-size: 25px;}
</style>
</head>
<body>
<p>this is a paragraph</p>
<span>this is a span</span>
<h1>this is heading</h1>
</body></html>
CSS Attribute Selector
14
Attribute Selector:
It is possible to style HTML elements that have specific attributes or attribute
values.
[attribute] Selector
The [attribute] selector is used to select elements with a specified attribute.
selector[attribute] { CSS code..}
[attribute="value"] Selector
The [attribute="value"] selector is used to select elements with a specified
attribute and value.
selector[attribute=“value”] { CSS code..}
Attribute example(1):
CSS Attribute Selector
15
<!DOCTYPE html><html><head>
<style>
a[target] {
background-color: yellow;
}
</style>
</head>
<body>
<p>The links with a target attribute gets a yellow background:</p>
<a href=“www.w3schools.com ">w3schools.com</a>
<a href="http://www.disney.com" target="_blank">disney.com</a>
<a href="http://www.wikipedia.org" target="_top">wikipedia.org</a>
body></html>
e1_attribute
Attribute example(2):
CSS Attribute Selector
16
<!DOCTYPE html><html><head>
<style>
a[target=_blank] {
background-color: yellow;
}
</style>
</head>
<body>
<p>The link with target="_blank" gets a yellow background:</p>
<a href="http://www.example.com">example.com</a>
<a href="http://www.disney.com" target="_blank">disney.com</a>
<a href="http://www.wikipedia.org" target="_top">wikipedia.org</a>
body></html>
e2_attribute-value
CSS Attribute Selectors
17
There are others like:
• CSS [attribute~="value"] Selector: select elements with an attribute value
containing a specified word.(the word must be separated with others by space)
• CSS [attribute|="value"] Selector : select elements with the specified
attribute starting with the specified value.
• CSS [attribute^="value"] Selector :select elements whose attribute value
begins with a specified value.
• CSS [attribute$="value"] Selector :select elements whose attribute value ends
with a specified value.
• CSS [attribute*="value"] Selector :select elements whose attribute value
contains a specified value.
e3_mor-attr-sel
Note: The value has to be a whole word, either alone, like class="top", or followed by a hyphen( - ), like
class="top-text"!
Note: The value does not have to be a whole word!
Note: The value does not have to be a whole word!
Note: The value does not have to be a whole word!
CSS Combinators Selector
18
• A combinator is something that explains the relationship between the selectors.
• A CSS selector can contain more than one simple selector. Between the simple
selectors, we can include a combinator.
• There are four different combinators in CSS3:
1. descendant selector(space):matches all elements that are descendants of a
specified element.
2. child selector(>) :selects all elements that are the immediate children of a
specified element.
3. adjacent sibling selector(+):selects all elements that are the adjacent
siblings of a specified element.
4. general sibling selector (~):selects all elements that are siblings of a
specified element.
div p { background-color: yellow;}
div > p { background-color: yellow;}
div + p { background-color: yellow;}
div ~ p { background-color: yellow;}
body
h1
i
p
i
Combinators example(1) : descendant selector(space)
CSS Combinators Selector
19
<!DOCTYPE html><html><head>
<style>
div p {
background-color: yellow;
}
</style>
</head>
<body>
<div>
<p>Paragraph 1 in the div.</p>
<p>Paragraph 2 in the div.</p>
<span><p>Paragraph 3 in the div.</p></span>
</div>
<p>Paragraph 4. Not in a div.</p>
<p>Paragraph 5. Not in a div.</p>
body></html>
e1_combinators
Combinators example(2) : child selector(>)
CSS Combinators Selector
20
<!DOCTYPE html><html><head>
<style>
div > p {
background-color: yellow;
}
</style>
</head>
<body>
<div>
<p>Paragraph 1 in the div.</p>
<p>Paragraph 2 in the div.</p>
<span><p>Paragraph 3 in the div.</p></span>
<!-- not Child but Descendant -->
</div>
<p>Paragraph 4. Not in a div.</p>
<p>Paragraph 5. Not in a div.</p>
body></html>
e2_combinators
Combinators example(3) : adjacent sibling selector (+)
CSS Combinators Selector
21
<!DOCTYPE html><html><head>
<style>
div + p {
background-color: yellow;
}
</style>
</head>
<body>
<div>
<p>Paragraph 1 in the div.</p>
<p>Paragraph 2 in the div.</p>
</div>
<p>Paragraph 3. Not in a div.</p>
<p>Paragraph 4. Not in a div.</p>
body></html>
e3_combinators
Combinators example(4) : general sibling selector(~)
CSS Combinators Selector
22
<!DOCTYPE html><html><head>
<style>
div ~ p {
background-color: yellow;
}
</style>
</head>
<body>
<div>
<p>Paragraph 1 in the div.</p>
<p>Paragraph 2 in the div.</p>
</div>
<p>Paragraph 3. Not in a div.</p>
<p>Paragraph 4. Not in a div.</p>
body></html>
e4_combinators

More Related Content

PDF
Web Design Course: CSS lecture 2
PDF
Web Design Course: CSS lecture 4
PDF
Web Design Course: CSS lecture 5
PDF
Web Design Course: CSS lecture 3
PPT
How Cascading Style Sheets (CSS) Works
ODP
CSS Basics
PPT
Introduction to HTML
ODP
HTML 5 Simple Tutorial Part 1
Web Design Course: CSS lecture 2
Web Design Course: CSS lecture 4
Web Design Course: CSS lecture 5
Web Design Course: CSS lecture 3
How Cascading Style Sheets (CSS) Works
CSS Basics
Introduction to HTML
HTML 5 Simple Tutorial Part 1

What's hot (20)

PDF
TUTORIAL DE CSS 2.0
PDF
Intro to HTML and CSS basics
PPT
PPTX
uptu web technology unit 2 Css
PPTX
HTML/CSS/java Script/Jquery
ODP
Introduction of Html/css/js
PPTX
PPTX
Html training slide
PPTX
Introduction to CSS
PPTX
HTML, CSS And JAVASCRIPT!
PPTX
An Overview of HTML, CSS & Java Script
PPT
CSS Basics
PPTX
uptu web technology unit 2 Css
PPTX
Css Basics
PPTX
(Fast) Introduction to HTML & CSS
ODP
Cascading Style Sheets - Part 01
PPT
Introduction to Cascading Style Sheets
TUTORIAL DE CSS 2.0
Intro to HTML and CSS basics
uptu web technology unit 2 Css
HTML/CSS/java Script/Jquery
Introduction of Html/css/js
Html training slide
Introduction to CSS
HTML, CSS And JAVASCRIPT!
An Overview of HTML, CSS & Java Script
CSS Basics
uptu web technology unit 2 Css
Css Basics
(Fast) Introduction to HTML & CSS
Cascading Style Sheets - Part 01
Introduction to Cascading Style Sheets
Ad

Similar to Web Design Course: CSS lecture 1 (20)

PPTX
Cascading Styling Sheets(CSS) simple design language intended to transform th...
PPTX
Css basics
PPTX
cascading style sheets- About cascading style sheets on the selectors
PPT
Lecture 5 _ Introduction to CSS-1.ppt. Cascading Style Sheet
PPTX
Cascading Style Sheets for web browser.pptx
PPTX
Lecture-6.pptx
DOCX
CSS Tutorial For Basic Students Studying
DOCX
Introducing CSS Selectors.docx
PPTX
WEB TECHNOLOGY Unit-2.pptx
PPTX
CSS_Day_ONE (W3schools)
PPT
CSS-part-1.ppt
PDF
Chapterrr_8_Introduction to CSS.pptx.pdf
PPTX
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
PPT
Cascading Style Sheets
PDF
Unit III CSS & JAVA Script.pdf
PPTX
LIS3353 SP12 Week 13
PPTX
4_css_intro.pptx. this ppt is based on css which is the required of web deve...
PPT
working with internet technologies using CSS
PPT
IP - Lecture 6, 7 Chapter-3 (3).ppt
PPTX
What is css
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Css basics
cascading style sheets- About cascading style sheets on the selectors
Lecture 5 _ Introduction to CSS-1.ppt. Cascading Style Sheet
Cascading Style Sheets for web browser.pptx
Lecture-6.pptx
CSS Tutorial For Basic Students Studying
Introducing CSS Selectors.docx
WEB TECHNOLOGY Unit-2.pptx
CSS_Day_ONE (W3schools)
CSS-part-1.ppt
Chapterrr_8_Introduction to CSS.pptx.pdf
Casecading Style Sheets for Hyper Text Transfer Protocol.pptx
Cascading Style Sheets
Unit III CSS & JAVA Script.pdf
LIS3353 SP12 Week 13
4_css_intro.pptx. this ppt is based on css which is the required of web deve...
working with internet technologies using CSS
IP - Lecture 6, 7 Chapter-3 (3).ppt
What is css
Ad

Recently uploaded (20)

PPT
340036916-American-Literature-Literary-Period-Overview.ppt
PDF
Cours de Système d'information about ERP.pdf
PDF
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
PPT
Chapter four Project-Preparation material
PDF
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
PPTX
ICG2025_ICG 6th steering committee 30-8-24.pptx
PDF
Power and position in leadershipDOC-20250808-WA0011..pdf
PPTX
svnfcksanfskjcsnvvjknsnvsdscnsncxasxa saccacxsax
PDF
How to Get Business Funding for Small Business Fast
PPTX
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
PDF
Tata consultancy services case study shri Sharda college, basrur
PDF
IFRS Notes in your pocket for study all the time
PDF
Roadmap Map-digital Banking feature MB,IB,AB
PDF
Deliverable file - Regulatory guideline analysis.pdf
PDF
Chapter 5_Foreign Exchange Market in .pdf
PDF
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
PPTX
3. HISTORICAL PERSPECTIVE UNIIT 3^..pptx
PDF
Digital Marketing & E-commerce Certificate Glossary.pdf.................
PDF
SIMNET Inc – 2023’s Most Trusted IT Services & Solution Provider
PDF
Unit 1 Cost Accounting - Cost sheet
340036916-American-Literature-Literary-Period-Overview.ppt
Cours de Système d'information about ERP.pdf
Stem Cell Market Report | Trends, Growth & Forecast 2025-2034
Chapter four Project-Preparation material
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
ICG2025_ICG 6th steering committee 30-8-24.pptx
Power and position in leadershipDOC-20250808-WA0011..pdf
svnfcksanfskjcsnvvjknsnvsdscnsncxasxa saccacxsax
How to Get Business Funding for Small Business Fast
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
Tata consultancy services case study shri Sharda college, basrur
IFRS Notes in your pocket for study all the time
Roadmap Map-digital Banking feature MB,IB,AB
Deliverable file - Regulatory guideline analysis.pdf
Chapter 5_Foreign Exchange Market in .pdf
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
3. HISTORICAL PERSPECTIVE UNIIT 3^..pptx
Digital Marketing & E-commerce Certificate Glossary.pdf.................
SIMNET Inc – 2023’s Most Trusted IT Services & Solution Provider
Unit 1 Cost Accounting - Cost sheet

Web Design Course: CSS lecture 1

  • 1. Web Programming and Design CSS (Cascading Style Sheet) By : Gheyath M. Othman
  • 2. Introduction to CSS (Cascading Style Sheet) 2 What is CSS ? • CSS stands for Cascading Style Sheets • CSS describes how HTML elements are to be displayed on screen, paper, or in other media • CSS saves a lot of work. It can control the layout of multiple web pages all at once • External style sheets are stored in CSS files
  • 3. Introduction to CSS (Cascading Style Sheet) 3 Som advantages of CSS: • Save time • Load page faster • Easy maintenance • Superior(larger) styles to HTML • Multiple device compatibility • Global web standards
  • 4. Introduction to CSS (Cascading Style Sheet) 4 Who Creates and Maintains CSS? CSS is created and maintained through a group of people within the W3C called the CSS Working Group. The CSS Working Group creates documents called specifications. When a specification has been discussed and officially ratified by W3C members, it becomes a recommendation. NOTE: The World Wide Web Consortium, or W3C is a group that makes recommendations about how the Internet works and how it should evolve.
  • 5. CSS Syntax 5 A CSS rule set consists of a selector and a declaration block. • The selector points to the HTML element you want to style • The declaration block contains one or more declarations separated by semicolons. • Each declaration includes a property name and a value assigned to property, separated by a colon.
  • 6. In the following example all <p> elements will be center-aligned, with a red text color: <!DOCTYPE html> <html> <head> <style> p { color: red; text-align: center; } </style> </head> <body> <p>Hello World!</p> <p>This paragraph is styled with CSS.</p> </body></html> e1_first-ex>> CSS Syntax 6 NOTE: To make the CSS code more readable, you can put one declaration on each line.
  • 7. • CSS selectors allow you to select and manipulate HTML elements. • CSS selectors are used to "find" (or select) HTML elements based on their id, class, type, attributes and more. CSS Selectors 7
  • 8. Element Selector: ▪ Element selector selects elements based on the element name. You can select all <p> elements on a page like this: e2_element-selector>> CSS Element Selector 8 <!DOCTYPE html><html> <head> <style> p { text-align: center; color: red; } </style> </head> <body> <p>All paragraphs will be affected </p> <p id="para1">Me too!</p> <p>And me!</p> </body> </html>
  • 9. id Selectors: ▪ The id selector uses the id attribute of an HTML element to select a specific element. ▪ An id should be unique within a page, so the id selector is used if you want to select a single, unique element. ▪ Use a hash character followed by the id element. “#id_name” LIKE: #red { text-align: center; color: red; } CSS id Selector 9 NOTE: ID name must not start with a number!. Also as pointed that id should be unique because java script is care about that..
  • 10. id Selector example: CSS id Selector 10 <!DOCTYPE html> <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> e3_id-selector>>
  • 11. class Selectors: ▪ The class selector selects elements with a specific class attribute. ▪ Unlike id selector, classes are not unique, so the same class can be used for multiple elements. ▪ Use a period character(.) followed by the class name. “.class_name” LIKE: .center { text-align: center; color: red; } ▪ You can also specify that only specific HTML elements should be affected by a class. p.center { text-align: center; color: red; } CSS Class Selector 11NOTE: CLASS name must not start with a number!
  • 12. class selector example: e4_class-selector>> e5_class-selector1>> CSS Class Selector 12 <!DOCTYPE html><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> <!DOCTYPE html><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>
  • 13. CSS Universal Selector 13 The universal selector is an asterisk; it is like a wildcard and matches all element types in the document. *{CSS code..} If you want a rule to apply to all elements, you can use this selector. Sometimes it is used for default values that will apply to the whole of the document (such as a font - family and font - size ) unless another more specific selector indicates that an element should use different values for these same properties. <!DOCTYPE html><html><head> <style type="text/css"> *{ color: red; font-size: 25px;} </style> </head> <body> <p>this is a paragraph</p> <span>this is a span</span> <h1>this is heading</h1> </body></html>
  • 14. CSS Attribute Selector 14 Attribute Selector: It is possible to style HTML elements that have specific attributes or attribute values. [attribute] Selector The [attribute] selector is used to select elements with a specified attribute. selector[attribute] { CSS code..} [attribute="value"] Selector The [attribute="value"] selector is used to select elements with a specified attribute and value. selector[attribute=“value”] { CSS code..}
  • 15. Attribute example(1): CSS Attribute Selector 15 <!DOCTYPE html><html><head> <style> a[target] { background-color: yellow; } </style> </head> <body> <p>The links with a target attribute gets a yellow background:</p> <a href=“www.w3schools.com ">w3schools.com</a> <a href="http://www.disney.com" target="_blank">disney.com</a> <a href="http://www.wikipedia.org" target="_top">wikipedia.org</a> body></html> e1_attribute
  • 16. Attribute example(2): CSS Attribute Selector 16 <!DOCTYPE html><html><head> <style> a[target=_blank] { background-color: yellow; } </style> </head> <body> <p>The link with target="_blank" gets a yellow background:</p> <a href="http://www.example.com">example.com</a> <a href="http://www.disney.com" target="_blank">disney.com</a> <a href="http://www.wikipedia.org" target="_top">wikipedia.org</a> body></html> e2_attribute-value
  • 17. CSS Attribute Selectors 17 There are others like: • CSS [attribute~="value"] Selector: select elements with an attribute value containing a specified word.(the word must be separated with others by space) • CSS [attribute|="value"] Selector : select elements with the specified attribute starting with the specified value. • CSS [attribute^="value"] Selector :select elements whose attribute value begins with a specified value. • CSS [attribute$="value"] Selector :select elements whose attribute value ends with a specified value. • CSS [attribute*="value"] Selector :select elements whose attribute value contains a specified value. e3_mor-attr-sel Note: The value has to be a whole word, either alone, like class="top", or followed by a hyphen( - ), like class="top-text"! Note: The value does not have to be a whole word! Note: The value does not have to be a whole word! Note: The value does not have to be a whole word!
  • 18. CSS Combinators Selector 18 • A combinator is something that explains the relationship between the selectors. • A CSS selector can contain more than one simple selector. Between the simple selectors, we can include a combinator. • There are four different combinators in CSS3: 1. descendant selector(space):matches all elements that are descendants of a specified element. 2. child selector(>) :selects all elements that are the immediate children of a specified element. 3. adjacent sibling selector(+):selects all elements that are the adjacent siblings of a specified element. 4. general sibling selector (~):selects all elements that are siblings of a specified element. div p { background-color: yellow;} div > p { background-color: yellow;} div + p { background-color: yellow;} div ~ p { background-color: yellow;} body h1 i p i
  • 19. Combinators example(1) : descendant selector(space) CSS Combinators Selector 19 <!DOCTYPE html><html><head> <style> div p { background-color: yellow; } </style> </head> <body> <div> <p>Paragraph 1 in the div.</p> <p>Paragraph 2 in the div.</p> <span><p>Paragraph 3 in the div.</p></span> </div> <p>Paragraph 4. Not in a div.</p> <p>Paragraph 5. Not in a div.</p> body></html> e1_combinators
  • 20. Combinators example(2) : child selector(>) CSS Combinators Selector 20 <!DOCTYPE html><html><head> <style> div > p { background-color: yellow; } </style> </head> <body> <div> <p>Paragraph 1 in the div.</p> <p>Paragraph 2 in the div.</p> <span><p>Paragraph 3 in the div.</p></span> <!-- not Child but Descendant --> </div> <p>Paragraph 4. Not in a div.</p> <p>Paragraph 5. Not in a div.</p> body></html> e2_combinators
  • 21. Combinators example(3) : adjacent sibling selector (+) CSS Combinators Selector 21 <!DOCTYPE html><html><head> <style> div + p { background-color: yellow; } </style> </head> <body> <div> <p>Paragraph 1 in the div.</p> <p>Paragraph 2 in the div.</p> </div> <p>Paragraph 3. Not in a div.</p> <p>Paragraph 4. Not in a div.</p> body></html> e3_combinators
  • 22. Combinators example(4) : general sibling selector(~) CSS Combinators Selector 22 <!DOCTYPE html><html><head> <style> div ~ p { background-color: yellow; } </style> </head> <body> <div> <p>Paragraph 1 in the div.</p> <p>Paragraph 2 in the div.</p> </div> <p>Paragraph 3. Not in a div.</p> <p>Paragraph 4. Not in a div.</p> body></html> e4_combinators