SlideShare a Scribd company logo
1 of 32
Download to read offline
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

CSS+Selector+Tutorial+Slides.pdf
CSS+Selector+Tutorial+Slides.pdfCSS+Selector+Tutorial+Slides.pdf
CSS+Selector+Tutorial+Slides.pdfkuppaidon
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2Shawn Calvert
 
13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / SpecificityIn a Rocket
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learnerYoeung Vibol
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13Amanda Case
 
12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & groupIn a Rocket
 
10- Learn CSS Fundamentals / Pseudo-elements
10- Learn CSS Fundamentals / Pseudo-elements10- Learn CSS Fundamentals / Pseudo-elements
10- Learn CSS Fundamentals / Pseudo-elementsIn a Rocket
 
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box ModelCSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Modeljamiecavanaugh
 
14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / Inheritance14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / InheritanceIn a Rocket
 
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 DataWaveData Works MD
 
Type safe embedded domain-specific languages
Type safe embedded domain-specific languagesType safe embedded domain-specific languages
Type safe embedded domain-specific languagesArthur Xavier
 

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
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
 
13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity
 
Java script -23jan2015
Java script -23jan2015Java script -23jan2015
Java script -23jan2015
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
LIS3353 SP12 Week 13
LIS3353 SP12 Week 13LIS3353 SP12 Week 13
LIS3353 SP12 Week 13
 
Css3
Css3Css3
Css3
 
12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group12- Learn CSS Fundamentals / Mix & group
12- Learn CSS Fundamentals / Mix & group
 
10- Learn CSS Fundamentals / Pseudo-elements
10- Learn CSS Fundamentals / Pseudo-elements10- Learn CSS Fundamentals / Pseudo-elements
10- Learn CSS Fundamentals / Pseudo-elements
 
CSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box ModelCSS, CSS Selectors, CSS Box Model
CSS, CSS Selectors, CSS Box Model
 
14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / Inheritance14- Learn CSS Fundamentals / Inheritance
14- Learn CSS Fundamentals / Inheritance
 
J Query Public
J Query PublicJ Query Public
J Query Public
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
AAVN_Presentation_SASS.pptx
AAVN_Presentation_SASS.pptxAAVN_Presentation_SASS.pptx
AAVN_Presentation_SASS.pptx
 
Less css
Less cssLess css
Less css
 
Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)Data Binding Intro (Windows 8)
Data Binding Intro (Windows 8)
 
Introducing DataWave
Introducing DataWaveIntroducing DataWave
Introducing DataWave
 
Type safe embedded domain-specific languages
Type safe embedded domain-specific languagesType safe embedded domain-specific languages
Type safe embedded domain-specific languages
 

More from 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 & itemsIn a Rocket
 
2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / ContextIn 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 setupIn a Rocket
 
17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / UnitsIn a Rocket
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / BackgroundIn a Rocket
 
15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / ColorIn a Rocket
 
2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text FormattingIn 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 MinutesIn a Rocket
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionIn a Rocket
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionIn a Rocket
 

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
 
2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context2- Learn Flexbox & CSS Grid / Context
2- Learn Flexbox & CSS Grid / Context
 
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
 
17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units17- Learn CSS Fundamentals / Units
17- Learn CSS Fundamentals / Units
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background
 
15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color15- Learn CSS Fundamentals / Color
15- Learn CSS Fundamentals / Color
 
2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting2- Learn HTML Fundamentals / Text Formatting
2- Learn HTML Fundamentals / Text Formatting
 
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
 
Learn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming ConventionLearn SUIT: CSS Naming Convention
Learn SUIT: CSS Naming Convention
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 

Recently uploaded

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 

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