SlideShare a Scribd company logo
Lab#5 Style and Selector 322432 Web Design Technology By Yaowaluck Promdee, Sumonta Kasemvilas
CSS Basic 
Single Source of HTML 
CSS Style Sheet 
Web Browser 
Other Media 
Print Output 
Formatting data for multiple destination 
Server 
Clients
CSS Syntax 
selector { property:value } 
selector { property1:value1; property2:value2 }
How to use Style Sheet 
1. Inline Styles 
<Tag style="property:value;"> 
<p style="color:black; font-family:Arial; font-weight:bold”>Hello World!!</p> 
An inline style loses many of the advantages of a style sheet. Use this method sparingly! 
To use inline styles, add the style attribute to the relevant tag. The style attribute can contain any CSS property.
2. Internal Style Sheet 
<style type="text/css"> 
<!--selector {property1: value1; property2: value2}... --> 
</style> 
An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, inside the <style> tag
3. External Style Sheet 
<link rel="stylesheet" type="text/css" href="URL file.css"> 
<html> 
<head> 
<link rel="stylesheet" type="text/css" href="mystyle.css"> 
</head> 
<body> 
Example 
An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing just one file. 
Each page must include a link to the style sheet with the <link> tag. The <link> tag goes inside the head section:
CSS Selector 
- The element Selector 
- The id Selector 
- The class Selector
1. Element Selector 
p { text-align: center; color: red; } 
<p>Example1</p> 
<p id="paragraph">Example2</p> 
<p>Example3</p> 
The element selector selects elements based on the element name.
2. Id Selector 
#paragraph { text-align: center; color: red; } 
<p id="paragraph">Hello World!</p> 
<p>This paragraph is not affected by the style.</p> 
The id selector uses the id attribute of an HTML tag to find the specific element. 
An id should be unique within a page, so you should use the id selector when you want to find a single, unique element.
3. Class Selector 
.center { 
text-align: center; 
color: red; } 
<h1 class="center">sentence1</h1> 
<p class="center">sentence2</p> 
The class selector finds elements with the specific class. 
The class selector uses the HTML class attribute. 
To find elements with a specific class, write a period character, followed by the name of the class:
Example Selector Class attribute 
.topic {color:red; 
font-family:Arial; 
font-weight:bold; 
text-align:center; } 
<div class="topic”>Heading</div> 
<p class="topic”>Topic Name</p> 
p.topic{color:red; font-family:Arial; font-weight:bold; text-align:center }
Assignment#5 Style and Selectors 
Create a Webpage to present your two favorite movies using CSS (eg. all selectors in class today: element, class, id sector) and you must comment your own CSS code. 
Grade will be based on your CSS technique and look and feel of the Web page.
Example

More Related Content

What's hot

CSS Font & Text style
CSS Font & Text style CSS Font & Text style
CSS Font & Text style
Yaowaluck Promdee
 
Design sitemap
Design sitemapDesign sitemap
Design sitemap
Yaowaluck Promdee
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
Amit Kumar Singh
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
Doris Chen
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Mario Hernandez
 
CSS Dasar #3 : Penempatan CSS
CSS Dasar #3 : Penempatan CSSCSS Dasar #3 : Penempatan CSS
CSS Dasar #3 : Penempatan CSS
Sandhika Galih
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
Sanjeev Kumar
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
Amit Tyagi
 
CSS - Styling Links and Creating Navigation
CSS - Styling Links and Creating NavigationCSS - Styling Links and Creating Navigation
CSS - Styling Links and Creating Navigation
Vidya Ananthanarayanan
 
Html, CSS & Web Designing
Html, CSS & Web DesigningHtml, CSS & Web Designing
Html, CSS & Web Designing
Leslie Steele
 
Css
CssCss
CSS
CSSCSS
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
Webtech Learning
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
Singsys Pte Ltd
 
CSS Dasar #8 : Pseudo-class
CSS Dasar #8 : Pseudo-classCSS Dasar #8 : Pseudo-class
CSS Dasar #8 : Pseudo-class
Sandhika Galih
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
Ana Cidre
 
CSS Dasar #5 : Text Styling
CSS Dasar #5 : Text StylingCSS Dasar #5 : Text Styling
CSS Dasar #5 : Text Styling
Sandhika Galih
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
Fahim Abdullah
 

What's hot (20)

CSS Font & Text style
CSS Font & Text style CSS Font & Text style
CSS Font & Text style
 
Design sitemap
Design sitemapDesign sitemap
Design sitemap
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
CSS Dasar #3 : Penempatan CSS
CSS Dasar #3 : Penempatan CSSCSS Dasar #3 : Penempatan CSS
CSS Dasar #3 : Penempatan CSS
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
CSS - Styling Links and Creating Navigation
CSS - Styling Links and Creating NavigationCSS - Styling Links and Creating Navigation
CSS - Styling Links and Creating Navigation
 
Html, CSS & Web Designing
Html, CSS & Web DesigningHtml, CSS & Web Designing
Html, CSS & Web Designing
 
Css
CssCss
Css
 
CSS
CSSCSS
CSS
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
CSS Dasar #8 : Pseudo-class
CSS Dasar #8 : Pseudo-classCSS Dasar #8 : Pseudo-class
CSS Dasar #8 : Pseudo-class
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
 
CSS Dasar #5 : Text Styling
CSS Dasar #5 : Text StylingCSS Dasar #5 : Text Styling
CSS Dasar #5 : Text Styling
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 

Similar to Lab#5 style and selector

Basic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdfBasic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdf
Kalyani Government Engineering College
 
CSS
CSSCSS
CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)
Saurabh Anand
 
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
 
Web technology Unit-II Part-C
Web technology Unit-II Part-CWeb technology Unit-II Part-C
Web technology Unit-II Part-C
SSN College of Engineering, Kalavakkam
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
Sónia
 
An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)
Ardee Aram
 
chitra
chitrachitra
chitra
sweet chitra
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1
Gheyath M. Othman
 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introduction
Himanshu Pathak
 
Lec 1
Lec 1Lec 1
Css.html
Css.htmlCss.html
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssTesfaye Yenealem
 
Angular JS
Angular JSAngular JS
Angular JS
John Temoty Roca
 
Website design 2
Website design 2Website design 2
Website design 2
Mike Oakshott
 
1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf
AAFREEN SHAIKH
 
CLIENT SIDE PROGRAMMING
CLIENT SIDE PROGRAMMINGCLIENT SIDE PROGRAMMING
CLIENT SIDE PROGRAMMING
Prof Ansari
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
Gene Babon
 

Similar to Lab#5 style and selector (20)

Basic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdfBasic Details of HTML and CSS.pdf
Basic Details of HTML and CSS.pdf
 
CSS.pdf
CSS.pdfCSS.pdf
CSS.pdf
 
CSS
CSSCSS
CSS
 
CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)CSS(Cascading Stylesheet)
CSS(Cascading Stylesheet)
 
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...
 
Web technology Unit-II Part-C
Web technology Unit-II Part-CWeb technology Unit-II Part-C
Web technology Unit-II Part-C
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)
 
chitra
chitrachitra
chitra
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1
 
Cascading style sheet an introduction
Cascading style sheet   an introductionCascading style sheet   an introduction
Cascading style sheet an introduction
 
Lec 1
Lec 1Lec 1
Lec 1
 
Css.html
Css.htmlCss.html
Css.html
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 
Angular JS
Angular JSAngular JS
Angular JS
 
Website design 2
Website design 2Website design 2
Website design 2
 
Cmsc 100 xhtml and css
Cmsc 100 xhtml and cssCmsc 100 xhtml and css
Cmsc 100 xhtml and css
 
1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf
 
CLIENT SIDE PROGRAMMING
CLIENT SIDE PROGRAMMINGCLIENT SIDE PROGRAMMING
CLIENT SIDE PROGRAMMING
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 

More from Yaowaluck Promdee

A basic of UX for beginner
A basic of UX for beginnerA basic of UX for beginner
A basic of UX for beginner
Yaowaluck Promdee
 
TCAS 2563
TCAS 2563TCAS 2563
Portfolio design
Portfolio designPortfolio design
Portfolio design
Yaowaluck Promdee
 
Concept to creation story and storyboard
Concept to creation  story and storyboard Concept to creation  story and storyboard
Concept to creation story and storyboard
Yaowaluck Promdee
 
Observation and interviewing
Observation and interviewingObservation and interviewing
Observation and interviewing
Yaowaluck Promdee
 
Requirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvasRequirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvas
Yaowaluck Promdee
 
Good bad design
Good bad designGood bad design
Good bad design
Yaowaluck Promdee
 
Bootstrap Framework
Bootstrap Framework Bootstrap Framework
Bootstrap Framework
Yaowaluck Promdee
 
Graphic, Color and tools
Graphic, Color and toolsGraphic, Color and tools
Graphic, Color and tools
Yaowaluck Promdee
 
Page layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSSPage layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSS
Yaowaluck Promdee
 
Style and Selector Part2
Style and Selector Part2Style and Selector Part2
Style and Selector Part2
Yaowaluck Promdee
 
HTML 5
HTML 5HTML 5
Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations
Yaowaluck Promdee
 
Web Interface
Web InterfaceWeb Interface
Web Interface
Yaowaluck Promdee
 
Game design
Game designGame design
Game design
Yaowaluck Promdee
 
Powerpoint
Powerpoint Powerpoint
Powerpoint
Yaowaluck Promdee
 
Program Interface
Program Interface Program Interface
Program Interface
Yaowaluck Promdee
 
Mobile Interface
Mobile Interface   Mobile Interface
Mobile Interface
Yaowaluck Promdee
 
Personas and scenario
Personas and scenarioPersonas and scenario
Personas and scenario
Yaowaluck Promdee
 
Ux design process
Ux design processUx design process
Ux design process
Yaowaluck Promdee
 

More from Yaowaluck Promdee (20)

A basic of UX for beginner
A basic of UX for beginnerA basic of UX for beginner
A basic of UX for beginner
 
TCAS 2563
TCAS 2563TCAS 2563
TCAS 2563
 
Portfolio design
Portfolio designPortfolio design
Portfolio design
 
Concept to creation story and storyboard
Concept to creation  story and storyboard Concept to creation  story and storyboard
Concept to creation story and storyboard
 
Observation and interviewing
Observation and interviewingObservation and interviewing
Observation and interviewing
 
Requirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvasRequirement gathering-and-lean-canvas
Requirement gathering-and-lean-canvas
 
Good bad design
Good bad designGood bad design
Good bad design
 
Bootstrap Framework
Bootstrap Framework Bootstrap Framework
Bootstrap Framework
 
Graphic, Color and tools
Graphic, Color and toolsGraphic, Color and tools
Graphic, Color and tools
 
Page layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSSPage layouts flexible and fixed layout with CSS
Page layouts flexible and fixed layout with CSS
 
Style and Selector Part2
Style and Selector Part2Style and Selector Part2
Style and Selector Part2
 
HTML 5
HTML 5HTML 5
HTML 5
 
Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations
 
Web Interface
Web InterfaceWeb Interface
Web Interface
 
Game design
Game designGame design
Game design
 
Powerpoint
Powerpoint Powerpoint
Powerpoint
 
Program Interface
Program Interface Program Interface
Program Interface
 
Mobile Interface
Mobile Interface   Mobile Interface
Mobile Interface
 
Personas and scenario
Personas and scenarioPersonas and scenario
Personas and scenario
 
Ux design process
Ux design processUx design process
Ux design process
 

Recently uploaded

Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 

Recently uploaded (20)

Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 

Lab#5 style and selector

  • 1. Lab#5 Style and Selector 322432 Web Design Technology By Yaowaluck Promdee, Sumonta Kasemvilas
  • 2. CSS Basic Single Source of HTML CSS Style Sheet Web Browser Other Media Print Output Formatting data for multiple destination Server Clients
  • 3. CSS Syntax selector { property:value } selector { property1:value1; property2:value2 }
  • 4. How to use Style Sheet 1. Inline Styles <Tag style="property:value;"> <p style="color:black; font-family:Arial; font-weight:bold”>Hello World!!</p> An inline style loses many of the advantages of a style sheet. Use this method sparingly! To use inline styles, add the style attribute to the relevant tag. The style attribute can contain any CSS property.
  • 5. 2. Internal Style Sheet <style type="text/css"> <!--selector {property1: value1; property2: value2}... --> </style> An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, inside the <style> tag
  • 6. 3. External Style Sheet <link rel="stylesheet" type="text/css" href="URL file.css"> <html> <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> <body> Example An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing just one file. Each page must include a link to the style sheet with the <link> tag. The <link> tag goes inside the head section:
  • 7. CSS Selector - The element Selector - The id Selector - The class Selector
  • 8. 1. Element Selector p { text-align: center; color: red; } <p>Example1</p> <p id="paragraph">Example2</p> <p>Example3</p> The element selector selects elements based on the element name.
  • 9. 2. Id Selector #paragraph { text-align: center; color: red; } <p id="paragraph">Hello World!</p> <p>This paragraph is not affected by the style.</p> The id selector uses the id attribute of an HTML tag to find the specific element. An id should be unique within a page, so you should use the id selector when you want to find a single, unique element.
  • 10. 3. Class Selector .center { text-align: center; color: red; } <h1 class="center">sentence1</h1> <p class="center">sentence2</p> The class selector finds elements with the specific class. The class selector uses the HTML class attribute. To find elements with a specific class, write a period character, followed by the name of the class:
  • 11. Example Selector Class attribute .topic {color:red; font-family:Arial; font-weight:bold; text-align:center; } <div class="topic”>Heading</div> <p class="topic”>Topic Name</p> p.topic{color:red; font-family:Arial; font-weight:bold; text-align:center }
  • 12. Assignment#5 Style and Selectors Create a Webpage to present your two favorite movies using CSS (eg. all selectors in class today: element, class, id sector) and you must comment your own CSS code. Grade will be based on your CSS technique and look and feel of the Web page.