SlideShare a Scribd company logo
IN A ROCKET
Learn front-end development at rocket speed
CSS CSS FUNDAMENTALS
SelectorsAttribute
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE
PRESENCE 

AND VALUE
SELECTORS
SUBSTRING
MATCHING
ATTRIBUTE
SELECTORS
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Attribute presence 

and value selectors
[attribute]
[attribute=value]

[attribute~=value]

[attribute|=value]
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE SELECTOR
With this code all elements with the target attribute are shown in green.
Selects all elements with a specific attribute.
[target] {color: green}
Syntax [attribute] {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
ATTRIBUTE SELECTOR
<body>
<a href="#" target="_blank">First link.</a>
<a href="#">Second link.</a>
</body>
[target] { color: green; }
Web page title
index.html
First link.
Second link.
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Attribute presence 

and value selectors
[attribute]

[attribute=value]
[attribute~=value]

[attribute|=value]
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE SELECTOR
With this code all elements with the attribute target and the value _blank are shown in green.
Selects all elements with a specific attribute and value.
[target=_blank] {color: green}
Syntax [attribute=value] {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
ATTRIBUTE SELECTOR
<body>
<a href="#" target="_blank">First link.</a><br>
<a href="#" target="_top">Second link.</a><br>
<a href="http://wikipedia.org">Wikipedia.</a><br>
<img src="world.png" alt="World">
</body>
[target=_blank] { color: red; }
[href=http://wikipedia.org] { color: green; }
[src=world.png] { background: green; }
Web page title
index.html
First link.
Second link.
Wikipedia.
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
ATTRIBUTE SELECTOR
<body>
<form>
Name: <input type="text">
<input type="submit" value="Send">
</form>
</body>
[type=submit] { background: red; }
Web page title
index.html
Name:
Send
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Attribute presence 

and value selectors
[attribute]

[attribute=value]

[attribute~=value]
[attribute|=value]
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE SELECTOR
With this code all elements with the attribute target and the value deal are shown in green.
Selects all elements with a specific attribute, but only if the value is one of a space-separated list of
words.
[data-item~=deal] {color: green}
Syntax [attribute~=value] {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
ATTRIBUTE SELECTOR
<body>
<article data-item="food deal choco">
<h2>Best chocolate ever!</h2>
<p>Product info.</p>
</article>
<article data-item="food choco">
<h2>Just white chocolate</h2>
<p>Product info.</p>
</article>
</body>
[data-item~=deal] { color: green; }
Web page title
index.html
Best chocolate ever!
Product info.
Just white chocolate
Product info.
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Attribute presence 

and value selectors
[attribute]

[attribute=value]

[attribute~=value]

[attribute|=value]
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE SELECTOR
With this code all elements with the hreflang attribute and 

its value beginning with en are shown in green.
Selects all elements with a specific attribute if their value is exactly a particular text or begins with it.
[hreflang|=en] {color: green}
Syntax [attribute|=value] {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
ATTRIBUTE SELECTOR
<body>
<a href="#" hreflang="en">Wikipedia English</a><br>
<a href="#" hreflang="en-us">Wikipedia US</a><br>
<a href="#" hreflang="en-gb">Wikipedia UK</a><br>
<a href="#" hreflang="fr">Wikipedia France</a>
</body>
[hreflang|=en] { color: green; }
Web page title
index.html
Wikipedia English
Wikipedia US

Wikipedia UK

Wikipedia France
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE
PRESENCE 

AND VALUE
SELECTORS
SUBSTRING
MATCHING
ATTRIBUTE
SELECTORS
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Substring matching 

attribute selectors
[attribute^=value]

[attribute*=value]

[attribute$=value]
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
value
^Begins with
*Contains
$
Ends with
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Substring matching 

attribute selectors
[attribute^=value]
[attribute*=value]

[attribute$=value]
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE SELECTOR
With this code all elements with the data-item attribute and 

its value beginning with food are shown in green.
Selects all elements with a specific attribute if their value begins with a particular text.
[data-item^=food] {color: green}
Syntax [attribute^=value] {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
ATTRIBUTE SELECTOR
<body>
<article data-item="food choco black">
<h2>Best chocolate ever!</h2>
<p>Product info.</p>
</article>
<article data-item="choco food white">
<h2>Just white chocolate</h2>
<p>Product info.</p>
</article>
</body>
[data-item^=food] { color: green; }
Web page title
index.html
Best chocolate ever!
Product info.
Just white chocolate
Product info.
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Substring matching 

attribute selectors
[attribute^=value]

[attribute*=value]
[attribute$=value]
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE SELECTOR
With this code all elements with the data-item attribute and 

its value containing food are shown in green.
Selects all elements with a specific attribute if their value contains a particular text.
[data-item*=food] {color: green}
Syntax [attribute*=value] {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
ATTRIBUTE SELECTOR
<body>
<article data-item="choco food black">
<h2>Best chocolate ever!</h2>
<p>Product info.</p>
</article>
<article data-item="choco white food">
<h2>Just white chocolate</h2>
<p>Product info.</p>
</article>
</body>
[data-item*=food] { color: green; }
Web page title
index.html
Best chocolate ever!
Product info.
Just white chocolate
Product info.
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Substring matching 

attribute selectors
[attribute^=value]

[attribute*=value]

[attribute$=value]
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE SELECTOR
With this code all elements with the data-item attribute and 

its value ending with food are shown in green.
Selects all elements with a specific attribute if their value ends with a particular text.
[data-item$=food] {color: green}
Syntax [attribute$=value] {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
ATTRIBUTE SELECTOR
<body>
<article data-item="choco food black">
<h2>Best chocolate ever!</h2>
<p>Product info.</p>
</article>
<article data-item="choco white food">
<h2>Just white chocolate</h2>
<p>Product info.</p>
</article>
</body>
[data-item$=food] { color: green; }
Web page title
index.html
Best chocolate ever!
Product info.
Just white chocolate
Product info.
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
ATTRIBUTE
PRESENCE 

AND VALUE
SELECTORS
SUBSTRING
MATCHING
ATTRIBUTE
SELECTORS
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
REFERENCE: W3C
SOURCE: Selectors Level 3 by W3C.
Learn front-end development at rocket speed
inarocket.com
by miguelsanchez.com
YOU CAN CONTINUE THIS COURSE FOR FREE ON
+ READY TO USE CODE
+ QUIZZES
+ FREE UPDATES
We respect your time

No more blah blah videos. Just straight to
the point slides with relevant information.
Ready to use code

Real code you can just copy and paste into
your real projects.
Step by step guides

Clear and concise steps to build real use
solutions. No missed points.
Learn front-end development at rocket speed
inarocket.com
IN A ROCKET
Learn front-end development at rocket speed
CSS CSS FUNDAMENTALS
SelectorsAttribute

More Related Content

Similar to 8- Learn CSS Fundamentals / Attribute selectors (20)

CSS+Selector+Tutorial+Slides.pdf
CSS+Selector+Tutorial+Slides.pdfCSS+Selector+Tutorial+Slides.pdf
CSS+Selector+Tutorial+Slides.pdf
kuppaidon
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
Meenakshi Paul
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
Shawn Calvert
 
13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity
In a Rocket
 
Java script -23jan2015
Java script -23jan2015Java script -23jan2015
Java script -23jan2015
Sasidhar Kothuru
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
Yoeung Vibol
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
Amanda Case
 
Css3
Css3Css3
Css3
Muhammad Hussein Poursaeed
 
12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group
In a Rocket
 
10- Learn CSS Fundamentals / Pseudo-elements
10- Learn CSS Fundamentals / Pseudo-elements10- Learn CSS Fundamentals / Pseudo-elements
10- Learn CSS Fundamentals / Pseudo-elements
In a Rocket
 
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box ModelCSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
jamiecavanaugh
 
14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / Inheritance14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / Inheritance
In a Rocket
 
J Query Public
J Query PublicJ Query Public
J Query Public
pradeepsilamkoti
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
M Vishnuvardhan Reddy
 
AAVN_Presentation_SASS.pptx
AAVN_Presentation_SASS.pptxAAVN_Presentation_SASS.pptx
AAVN_Presentation_SASS.pptx
Hoàng Nguyễn Mạnh
 
Wildcard Selectors in cascading style sheet .pdf
Wildcard Selectors in cascading style sheet .pdfWildcard Selectors in cascading style sheet .pdf
Wildcard Selectors in cascading style sheet .pdf
mehakgulzar473
 
Less css
Less cssLess css
Less css
Amit kumar
 
Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)
Gilbok Lee
 
Introducing DataWave
Introducing DataWaveIntroducing DataWave
Introducing DataWave
Data Works MD
 
CSS+Selector+Tutorial+Slides.pdf
CSS+Selector+Tutorial+Slides.pdfCSS+Selector+Tutorial+Slides.pdf
CSS+Selector+Tutorial+Slides.pdf
kuppaidon
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
Shawn Calvert
 
13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity
In a Rocket
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
Yoeung Vibol
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
Amanda Case
 
12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group
In a Rocket
 
10- Learn CSS Fundamentals / Pseudo-elements
10- Learn CSS Fundamentals / Pseudo-elements10- Learn CSS Fundamentals / Pseudo-elements
10- Learn CSS Fundamentals / Pseudo-elements
In a Rocket
 
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box ModelCSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
jamiecavanaugh
 
14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / Inheritance14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / Inheritance
In a Rocket
 
Wildcard Selectors in cascading style sheet .pdf
Wildcard Selectors in cascading style sheet .pdfWildcard Selectors in cascading style sheet .pdf
Wildcard Selectors in cascading style sheet .pdf
mehakgulzar473
 
Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)
Gilbok Lee
 
Introducing DataWave
Introducing DataWaveIntroducing DataWave
Introducing DataWave
Data Works MD
 

More from In a Rocket (10)

3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items
In a Rocket
 
2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context
In a Rocket
 
1- Learn Flexbox & CSS Grid / Environment setup
1- Learn Flexbox & CSS Grid / Environment setup1- Learn Flexbox & CSS Grid / Environment setup
1- Learn Flexbox & CSS Grid / Environment setup
In a Rocket
 
17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units
In a Rocket
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background
In a Rocket
 
15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color
In a Rocket
 
2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting
In a Rocket
 
1- Learn HTML Fundamentals / Start in 5 Minutes
1- Learn HTML Fundamentals / Start in 5 Minutes1- Learn HTML Fundamentals / Start in 5 Minutes
1- Learn HTML Fundamentals / Start in 5 Minutes
In a Rocket
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming Convention
In a Rocket
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items
In a Rocket
 
2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context
In a Rocket
 
1- Learn Flexbox & CSS Grid / Environment setup
1- Learn Flexbox & CSS Grid / Environment setup1- Learn Flexbox & CSS Grid / Environment setup
1- Learn Flexbox & CSS Grid / Environment setup
In a Rocket
 
17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units
In a Rocket
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background
In a Rocket
 
15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color
In a Rocket
 
2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting
In a Rocket
 
1- Learn HTML Fundamentals / Start in 5 Minutes
1- Learn HTML Fundamentals / Start in 5 Minutes1- Learn HTML Fundamentals / Start in 5 Minutes
1- Learn HTML Fundamentals / Start in 5 Minutes
In a Rocket
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming Convention
In a Rocket
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
In a Rocket
 
Ad

Recently uploaded (17)

原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
Taqyea
 
Cloud VPS Provider in India: The Best Hosting Solution for Your Business
Cloud VPS Provider in India: The Best Hosting Solution for Your BusinessCloud VPS Provider in India: The Best Hosting Solution for Your Business
Cloud VPS Provider in India: The Best Hosting Solution for Your Business
DanaJohnson510230
 
HPC_Course_Presentation_No_Images included.pptx
HPC_Course_Presentation_No_Images included.pptxHPC_Course_Presentation_No_Images included.pptx
HPC_Course_Presentation_No_Images included.pptx
naziaahmadnm
 
all Practical Project LAST summary note.docx
all Practical Project LAST summary note.docxall Practical Project LAST summary note.docx
all Practical Project LAST summary note.docx
seidjemal94
 
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptxTransport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
ssuser80a7e81
 
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdf
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdfEssential Tech Stack for Effective Shopify Dropshipping Integration.pdf
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdf
CartCoders
 
OSI_Security_Architecture Computer Science.pptx
OSI_Security_Architecture Computer Science.pptxOSI_Security_Architecture Computer Science.pptx
OSI_Security_Architecture Computer Science.pptx
faizanaseem873
 
How to Make Money as a Cam Model – Tips, Tools & Real Talk
How to Make Money as a Cam Model – Tips, Tools & Real TalkHow to Make Money as a Cam Model – Tips, Tools & Real Talk
How to Make Money as a Cam Model – Tips, Tools & Real Talk
Cam Sites Expert
 
10 Latest Technologies and Their Benefits to End.pptx
10 Latest Technologies and Their Benefits to End.pptx10 Latest Technologies and Their Benefits to End.pptx
10 Latest Technologies and Their Benefits to End.pptx
EphraimOOghodero
 
ARTIFICIAL INTELLIGENCE.pptx2565567765676
ARTIFICIAL INTELLIGENCE.pptx2565567765676ARTIFICIAL INTELLIGENCE.pptx2565567765676
ARTIFICIAL INTELLIGENCE.pptx2565567765676
areebaimtiazpmas
 
Frontier Unlimited Internet Setup Step-by-Step Guide.pdf
Frontier Unlimited Internet Setup Step-by-Step Guide.pdfFrontier Unlimited Internet Setup Step-by-Step Guide.pdf
Frontier Unlimited Internet Setup Step-by-Step Guide.pdf
Internet Bundle Now
 
basic to advance network security concepts
basic to advance network security conceptsbasic to advance network security concepts
basic to advance network security concepts
amansinght675
 
Networking concepts from zero to hero that covers the security aspects
Networking concepts from zero to hero that covers the security aspectsNetworking concepts from zero to hero that covers the security aspects
Networking concepts from zero to hero that covers the security aspects
amansinght675
 
Networking_Essentials_version_3.0_-_Module_7.pptx
Networking_Essentials_version_3.0_-_Module_7.pptxNetworking_Essentials_version_3.0_-_Module_7.pptx
Networking_Essentials_version_3.0_-_Module_7.pptx
elestirmen
 
AI REPLACING HUMANS /FATHER OF AI/BIRTH OF AI
AI REPLACING HUMANS /FATHER OF AI/BIRTH OF AIAI REPLACING HUMANS /FATHER OF AI/BIRTH OF AI
AI REPLACING HUMANS /FATHER OF AI/BIRTH OF AI
skdav34
 
5 Reasons cheap WordPress hosting is costing you more | Reversed Out
5 Reasons cheap WordPress hosting is costing you more | Reversed Out5 Reasons cheap WordPress hosting is costing you more | Reversed Out
5 Reasons cheap WordPress hosting is costing you more | Reversed Out
Reversed Out Creative
 
Presentation About The Buttons | Selma SALTIK
Presentation About The Buttons | Selma SALTIKPresentation About The Buttons | Selma SALTIK
Presentation About The Buttons | Selma SALTIK
SELMA SALTIK
 
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
原版西班牙马拉加大学毕业证(UMA毕业证书)如何办理
Taqyea
 
Cloud VPS Provider in India: The Best Hosting Solution for Your Business
Cloud VPS Provider in India: The Best Hosting Solution for Your BusinessCloud VPS Provider in India: The Best Hosting Solution for Your Business
Cloud VPS Provider in India: The Best Hosting Solution for Your Business
DanaJohnson510230
 
HPC_Course_Presentation_No_Images included.pptx
HPC_Course_Presentation_No_Images included.pptxHPC_Course_Presentation_No_Images included.pptx
HPC_Course_Presentation_No_Images included.pptx
naziaahmadnm
 
all Practical Project LAST summary note.docx
all Practical Project LAST summary note.docxall Practical Project LAST summary note.docx
all Practical Project LAST summary note.docx
seidjemal94
 
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptxTransport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
Transport Conjjjjjjjjjjjjjjjjjjjjjjjsulting by Slidesgo.pptx
ssuser80a7e81
 
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdf
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdfEssential Tech Stack for Effective Shopify Dropshipping Integration.pdf
Essential Tech Stack for Effective Shopify Dropshipping Integration.pdf
CartCoders
 
OSI_Security_Architecture Computer Science.pptx
OSI_Security_Architecture Computer Science.pptxOSI_Security_Architecture Computer Science.pptx
OSI_Security_Architecture Computer Science.pptx
faizanaseem873
 
How to Make Money as a Cam Model – Tips, Tools & Real Talk
How to Make Money as a Cam Model – Tips, Tools & Real TalkHow to Make Money as a Cam Model – Tips, Tools & Real Talk
How to Make Money as a Cam Model – Tips, Tools & Real Talk
Cam Sites Expert
 
10 Latest Technologies and Their Benefits to End.pptx
10 Latest Technologies and Their Benefits to End.pptx10 Latest Technologies and Their Benefits to End.pptx
10 Latest Technologies and Their Benefits to End.pptx
EphraimOOghodero
 
ARTIFICIAL INTELLIGENCE.pptx2565567765676
ARTIFICIAL INTELLIGENCE.pptx2565567765676ARTIFICIAL INTELLIGENCE.pptx2565567765676
ARTIFICIAL INTELLIGENCE.pptx2565567765676
areebaimtiazpmas
 
Frontier Unlimited Internet Setup Step-by-Step Guide.pdf
Frontier Unlimited Internet Setup Step-by-Step Guide.pdfFrontier Unlimited Internet Setup Step-by-Step Guide.pdf
Frontier Unlimited Internet Setup Step-by-Step Guide.pdf
Internet Bundle Now
 
basic to advance network security concepts
basic to advance network security conceptsbasic to advance network security concepts
basic to advance network security concepts
amansinght675
 
Networking concepts from zero to hero that covers the security aspects
Networking concepts from zero to hero that covers the security aspectsNetworking concepts from zero to hero that covers the security aspects
Networking concepts from zero to hero that covers the security aspects
amansinght675
 
Networking_Essentials_version_3.0_-_Module_7.pptx
Networking_Essentials_version_3.0_-_Module_7.pptxNetworking_Essentials_version_3.0_-_Module_7.pptx
Networking_Essentials_version_3.0_-_Module_7.pptx
elestirmen
 
AI REPLACING HUMANS /FATHER OF AI/BIRTH OF AI
AI REPLACING HUMANS /FATHER OF AI/BIRTH OF AIAI REPLACING HUMANS /FATHER OF AI/BIRTH OF AI
AI REPLACING HUMANS /FATHER OF AI/BIRTH OF AI
skdav34
 
5 Reasons cheap WordPress hosting is costing you more | Reversed Out
5 Reasons cheap WordPress hosting is costing you more | Reversed Out5 Reasons cheap WordPress hosting is costing you more | Reversed Out
5 Reasons cheap WordPress hosting is costing you more | Reversed Out
Reversed Out Creative
 
Presentation About The Buttons | Selma SALTIK
Presentation About The Buttons | Selma SALTIKPresentation About The Buttons | Selma SALTIK
Presentation About The Buttons | Selma SALTIK
SELMA SALTIK
 
Ad

8- Learn CSS Fundamentals / Attribute selectors

  • 1. IN A ROCKET Learn front-end development at rocket speed CSS CSS FUNDAMENTALS SelectorsAttribute
  • 2. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE PRESENCE 
 AND VALUE SELECTORS SUBSTRING MATCHING ATTRIBUTE SELECTORS
  • 3. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Attribute presence 
 and value selectors [attribute] [attribute=value] [attribute~=value] [attribute|=value]
  • 4. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE SELECTOR With this code all elements with the target attribute are shown in green. Selects all elements with a specific attribute. [target] {color: green} Syntax [attribute] {style properties}
  • 5. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser ATTRIBUTE SELECTOR <body> <a href="#" target="_blank">First link.</a> <a href="#">Second link.</a> </body> [target] { color: green; } Web page title index.html First link. Second link. READY TO USE CODE
  • 6. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Attribute presence 
 and value selectors [attribute] [attribute=value] [attribute~=value] [attribute|=value]
  • 7. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE SELECTOR With this code all elements with the attribute target and the value _blank are shown in green. Selects all elements with a specific attribute and value. [target=_blank] {color: green} Syntax [attribute=value] {style properties}
  • 8. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser ATTRIBUTE SELECTOR <body> <a href="#" target="_blank">First link.</a><br> <a href="#" target="_top">Second link.</a><br> <a href="http://wikipedia.org">Wikipedia.</a><br> <img src="world.png" alt="World"> </body> [target=_blank] { color: red; } [href=http://wikipedia.org] { color: green; } [src=world.png] { background: green; } Web page title index.html First link. Second link. Wikipedia. READY TO USE CODE
  • 9. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser ATTRIBUTE SELECTOR <body> <form> Name: <input type="text"> <input type="submit" value="Send"> </form> </body> [type=submit] { background: red; } Web page title index.html Name: Send READY TO USE CODE
  • 10. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Attribute presence 
 and value selectors [attribute] [attribute=value] [attribute~=value] [attribute|=value]
  • 11. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE SELECTOR With this code all elements with the attribute target and the value deal are shown in green. Selects all elements with a specific attribute, but only if the value is one of a space-separated list of words. [data-item~=deal] {color: green} Syntax [attribute~=value] {style properties}
  • 12. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser ATTRIBUTE SELECTOR <body> <article data-item="food deal choco"> <h2>Best chocolate ever!</h2> <p>Product info.</p> </article> <article data-item="food choco"> <h2>Just white chocolate</h2> <p>Product info.</p> </article> </body> [data-item~=deal] { color: green; } Web page title index.html Best chocolate ever! Product info. Just white chocolate Product info. READY TO USE CODE
  • 13. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Attribute presence 
 and value selectors [attribute] [attribute=value] [attribute~=value] [attribute|=value]
  • 14. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE SELECTOR With this code all elements with the hreflang attribute and 
 its value beginning with en are shown in green. Selects all elements with a specific attribute if their value is exactly a particular text or begins with it. [hreflang|=en] {color: green} Syntax [attribute|=value] {style properties}
  • 15. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser ATTRIBUTE SELECTOR <body> <a href="#" hreflang="en">Wikipedia English</a><br> <a href="#" hreflang="en-us">Wikipedia US</a><br> <a href="#" hreflang="en-gb">Wikipedia UK</a><br> <a href="#" hreflang="fr">Wikipedia France</a> </body> [hreflang|=en] { color: green; } Web page title index.html Wikipedia English Wikipedia US
 Wikipedia UK
 Wikipedia France READY TO USE CODE
  • 16. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE PRESENCE 
 AND VALUE SELECTORS SUBSTRING MATCHING ATTRIBUTE SELECTORS
  • 17. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Substring matching 
 attribute selectors [attribute^=value] [attribute*=value] [attribute$=value]
  • 18. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com value ^Begins with *Contains $ Ends with
  • 19. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Substring matching 
 attribute selectors [attribute^=value] [attribute*=value] [attribute$=value]
  • 20. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE SELECTOR With this code all elements with the data-item attribute and 
 its value beginning with food are shown in green. Selects all elements with a specific attribute if their value begins with a particular text. [data-item^=food] {color: green} Syntax [attribute^=value] {style properties}
  • 21. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser ATTRIBUTE SELECTOR <body> <article data-item="food choco black"> <h2>Best chocolate ever!</h2> <p>Product info.</p> </article> <article data-item="choco food white"> <h2>Just white chocolate</h2> <p>Product info.</p> </article> </body> [data-item^=food] { color: green; } Web page title index.html Best chocolate ever! Product info. Just white chocolate Product info. READY TO USE CODE
  • 22. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Substring matching 
 attribute selectors [attribute^=value] [attribute*=value] [attribute$=value]
  • 23. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE SELECTOR With this code all elements with the data-item attribute and 
 its value containing food are shown in green. Selects all elements with a specific attribute if their value contains a particular text. [data-item*=food] {color: green} Syntax [attribute*=value] {style properties}
  • 24. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser ATTRIBUTE SELECTOR <body> <article data-item="choco food black"> <h2>Best chocolate ever!</h2> <p>Product info.</p> </article> <article data-item="choco white food"> <h2>Just white chocolate</h2> <p>Product info.</p> </article> </body> [data-item*=food] { color: green; } Web page title index.html Best chocolate ever! Product info. Just white chocolate Product info. READY TO USE CODE
  • 25. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Substring matching 
 attribute selectors [attribute^=value] [attribute*=value] [attribute$=value]
  • 26. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE SELECTOR With this code all elements with the data-item attribute and 
 its value ending with food are shown in green. Selects all elements with a specific attribute if their value ends with a particular text. [data-item$=food] {color: green} Syntax [attribute$=value] {style properties}
  • 27. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser ATTRIBUTE SELECTOR <body> <article data-item="choco food black"> <h2>Best chocolate ever!</h2> <p>Product info.</p> </article> <article data-item="choco white food"> <h2>Just white chocolate</h2> <p>Product info.</p> </article> </body> [data-item$=food] { color: green; } Web page title index.html Best chocolate ever! Product info. Just white chocolate Product info. READY TO USE CODE
  • 28. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com ATTRIBUTE PRESENCE 
 AND VALUE SELECTORS SUBSTRING MATCHING ATTRIBUTE SELECTORS
  • 29. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com REFERENCE: W3C SOURCE: Selectors Level 3 by W3C.
  • 30. Learn front-end development at rocket speed inarocket.com by miguelsanchez.com YOU CAN CONTINUE THIS COURSE FOR FREE ON + READY TO USE CODE + QUIZZES + FREE UPDATES
  • 31. We respect your time
 No more blah blah videos. Just straight to the point slides with relevant information. Ready to use code
 Real code you can just copy and paste into your real projects. Step by step guides
 Clear and concise steps to build real use solutions. No missed points. Learn front-end development at rocket speed inarocket.com
  • 32. IN A ROCKET Learn front-end development at rocket speed CSS CSS FUNDAMENTALS SelectorsAttribute