SlideShare a Scribd company logo
IN A ROCKET
Learn front-end development at rocket speed
CSS CSS FUNDAMENTALS
Pseudo-element
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
“Pseudo-elements create abstractions about the document tree
beyond those specified by the document language. They may
also provide authors a way to refer to content that does not exist
in the source document.”
SOURCE: Selectors Level 3 by W3C.
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Pseudo-elements
::first-letter
::first-line

::before

::after
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
PSEUDO-ELEMENTS / FIRST-LETTER
With this code the first letter of all paragraphs is shown in green.
Represents the first letter of an element, if it is not preceded by any other content on its line.
p::first-letter {color: green}
Syntax selector::first-letter {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
PSEUDO-ELEMENTS / FIRST-LETTER
<body>
<p>Lorem ipsum dolor sit amet consectetur
adipisicing elit. Consequuntur eveniet dicta,
deleniti eos.</p>
<p>Debitis vitae minus magnam quod porro
numquam officia! Natus, culpa tenetur.</p>
</body>
p::first-letter { color: red; }
Web page title
index.html
Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur
eveniet dicta, deleniti eos.

Debitis vitae minus magnam quod porro numquam officia! Natus, culpa
tenetur.
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Pseudo-elements
::first-letter

::first-line
::before

::after
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
PSEUDO-ELEMENTS / FIRST-LINE
With this code the first line of all paragraphs is shown in green.
Describes the contents of the first formatted line of an element.
p::first-line {color: green}
Syntax selector::first-line {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
PSEUDO-ELEMENTS / FIRST-LINE
<body>
<p>Lorem ipsum dolor sit amet consectetur
adipisicing elit. Consequuntur eveniet dicta,
deleniti eos.</p>
<p>Debitis vitae minus magnam quod porro
numquam officia! Natus, culpa tenetur.</p>
</body>
p::first-line { color: green; }
Web page title
index.html
Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur
eveniet dicta, deleniti eos.

Debitis vitae minus magnam quod porro numquam officia! Natus, culpa
tenetur.
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Pseudo-elements
::first-letter

::first-line

::before
::after
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
PSEUDO-ELEMENTS / BEFORE
With this code all paragraphs are preceded by "★".
Describes generated content before an element’s content.
p::before {content: "★"}
Syntax selector::before {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
PSEUDO-ELEMENTS / BEFORE
<body>
<p>Lorem ipsum dolor sit amet consectetur
adipisicing elit. Consequuntur eveniet dicta,
deleniti eos.</p>
<p>Debitis vitae minus magnam quod porro
numquam officia! Natus, culpa tenetur.</p>
</body>
p::before { content: "★"; }
Web page title
index.html
★ Lorem ipsum dolor sit amet consectetur adipisicing elit.
Consequuntur eveniet dicta, deleniti eos.

★ Debitis vitae minus magnam quod porro numquam officia! Natus,
culpa tenetur.
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
Pseudo-elements
::first-letter

::first-line

::before

::after
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
PSEUDO-ELEMENTS / AFTER
With this code all paragraphs are finished with ✔.
Describes generated content after an element’s content.
p::after {content: "✔"}
Syntax selector::after {style properties}
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
PSEUDO-ELEMENTS / AFTER
<body>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
</body>
li::after { content: "✔"; }
Web page title
index.html
• Item 1 ✔

• Item 2 ✔

• Item 3 ✔
READY TO USE CODE
CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com
HTML CSS
Browser
PSEUDO-ELEMENTS / BEFORE + AFTER
<body>
<q>To be, or not to be,</q> Shakespeare
said, <q>that is the question.</q>
</body>
q::before { content: "“"; }
q::after { content: "”"; }
Web page title
index.html
“To be, or not to be,” Shakespeare said, “that is the question.”
READY TO USE CODE
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
Pseudo-element

More Related Content

What's hot (20)

PDF
Class 2: CSS Selectors, Classes & Ids
Erika Tarte
 
KEY
Flexible site structure with cake php
andygale
 
KEY
Html5的应用与推行
Sofish Lin
 
PDF
Layout with CSS
Mike Crabb
 
PDF
Intro to WordPress theme development
Thad Allender
 
KEY
Html5 nl
Wilfred Nas
 
PPTX
Web 102 INtro to CSS
Hawkman Academy
 
PDF
Modular HTML, CSS, & JS Workshop
Shay Howe
 
PPTX
Rapid and Responsive - UX to Prototype with Bootstrap
Josh Jeffryes
 
PDF
Intro to CSS
Randy Oest II
 
PDF
Html for beginners
Florian Letsch
 
PPTX
Introduction to HTML and CSS
danpaquette
 
PPT
Even faster web sites presentation 3
Felipe Lavín
 
PDF
2016 First steps with Angular 2 – enterjs
GeilDanke
 
PPTX
You and Your Stylesheet
Virginia DeBolt
 
PDF
LESS is More
jsmith92
 
PDF
Arizona WP - Building a WordPress Theme
certainstrings
 
PDF
Drawing the Line with Browser Compatibility
jsmith92
 
KEY
Fronttechnieken met HTML5 en de Slice-template
Inventis Web Architects
 
KEY
Color Me Flexible
Steven Merrill
 
Class 2: CSS Selectors, Classes & Ids
Erika Tarte
 
Flexible site structure with cake php
andygale
 
Html5的应用与推行
Sofish Lin
 
Layout with CSS
Mike Crabb
 
Intro to WordPress theme development
Thad Allender
 
Html5 nl
Wilfred Nas
 
Web 102 INtro to CSS
Hawkman Academy
 
Modular HTML, CSS, & JS Workshop
Shay Howe
 
Rapid and Responsive - UX to Prototype with Bootstrap
Josh Jeffryes
 
Intro to CSS
Randy Oest II
 
Html for beginners
Florian Letsch
 
Introduction to HTML and CSS
danpaquette
 
Even faster web sites presentation 3
Felipe Lavín
 
2016 First steps with Angular 2 – enterjs
GeilDanke
 
You and Your Stylesheet
Virginia DeBolt
 
LESS is More
jsmith92
 
Arizona WP - Building a WordPress Theme
certainstrings
 
Drawing the Line with Browser Compatibility
jsmith92
 
Fronttechnieken met HTML5 en de Slice-template
Inventis Web Architects
 
Color Me Flexible
Steven Merrill
 

Similar to 10- Learn CSS Fundamentals / Pseudo-elements (20)

PPTX
Css pseudo elements
AbhishekMondal42
 
PDF
The power of CSS pseudo-elements
Geoffrey Croftє
 
PDF
CSS Pseudo Elements.pdf
sonu kumar
 
PPTX
Introduction to Html5, css, Javascript and Jquery
valuebound
 
PDF
Learn css3
Mostafa Bayomi
 
PDF
BYOWHC823
Thinkful
 
PPT
Css advanced – session 5
Dr. Ramkumar Lakshminarayanan
 
PPTX
JAVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
KimberlyCasem1
 
PPTX
Types of Selectors (HTML)
Deanne Alcalde
 
PPTX
Building the basics (WordPress Ottawa 2014)
Christopher Ross
 
PPTX
Css pseudo-classes
Webtech Learning
 
PDF
15- Learn CSS Fundamentals / Color
In a Rocket
 
PDF
La build your own website september 5
Thinkful
 
PPT
Css class-02
Md Ali Hossain
 
PDF
Tfbyoweb.4.9.17
Jordan Zurowski
 
PDF
Tfbyoweb.4.9.17
Jordan Zurowski
 
PDF
11- Learn CSS Fundamentals / Combinators
In a Rocket
 
PPTX
Lab#1 - Front End Development
Walid Ashraf
 
PPTX
Html coding
Briana VanBuskirk
 
PPTX
Semantic markup language
Partnered Health
 
Css pseudo elements
AbhishekMondal42
 
The power of CSS pseudo-elements
Geoffrey Croftє
 
CSS Pseudo Elements.pdf
sonu kumar
 
Introduction to Html5, css, Javascript and Jquery
valuebound
 
Learn css3
Mostafa Bayomi
 
BYOWHC823
Thinkful
 
Css advanced – session 5
Dr. Ramkumar Lakshminarayanan
 
JAVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
KimberlyCasem1
 
Types of Selectors (HTML)
Deanne Alcalde
 
Building the basics (WordPress Ottawa 2014)
Christopher Ross
 
Css pseudo-classes
Webtech Learning
 
15- Learn CSS Fundamentals / Color
In a Rocket
 
La build your own website september 5
Thinkful
 
Css class-02
Md Ali Hossain
 
Tfbyoweb.4.9.17
Jordan Zurowski
 
Tfbyoweb.4.9.17
Jordan Zurowski
 
11- Learn CSS Fundamentals / Combinators
In a Rocket
 
Lab#1 - Front End Development
Walid Ashraf
 
Html coding
Briana VanBuskirk
 
Semantic markup language
Partnered Health
 
Ad

More from In a Rocket (11)

PDF
3- Learn Flexbox & CSS Grid / Container & items
In a Rocket
 
PDF
2- Learn Flexbox & CSS Grid / Context
In a Rocket
 
PDF
1- Learn Flexbox & CSS Grid / Environment setup
In a Rocket
 
PDF
17- Learn CSS Fundamentals / Units
In a Rocket
 
PDF
16- Learn CSS Fundamentals / Background
In a Rocket
 
PDF
12- Learn CSS Fundamentals / Mix & group
In a Rocket
 
PDF
8- Learn CSS Fundamentals / Attribute selectors
In a Rocket
 
PDF
2- Learn HTML Fundamentals / Text Formatting
In a Rocket
 
PDF
1- Learn HTML Fundamentals / Start in 5 Minutes
In a Rocket
 
PDF
Learn SUIT: CSS Naming Convention
In a Rocket
 
PDF
Learn BEM: CSS Naming Convention
In a Rocket
 
3- Learn Flexbox & CSS Grid / Container & items
In a Rocket
 
2- Learn Flexbox & CSS Grid / Context
In a Rocket
 
1- Learn Flexbox & CSS Grid / Environment setup
In a Rocket
 
17- Learn CSS Fundamentals / Units
In a Rocket
 
16- Learn CSS Fundamentals / Background
In a Rocket
 
12- Learn CSS Fundamentals / Mix & group
In a Rocket
 
8- Learn CSS Fundamentals / Attribute selectors
In a Rocket
 
2- Learn HTML Fundamentals / Text Formatting
In a Rocket
 
1- Learn HTML Fundamentals / Start in 5 Minutes
In a Rocket
 
Learn SUIT: CSS Naming Convention
In a Rocket
 
Learn BEM: CSS Naming Convention
In a Rocket
 
Ad

Recently uploaded (20)

PPTX
Ransomware attack and its effects on cyber crimes
ShilpaShreeD
 
PPTX
CHAPTER 1 - PART 3 FOR GRADE 11 STUDENTS
FSBTLEDNathanVince
 
PDF
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
PDF
web application development company in bangalore.pdf
https://dkpractice.co.in/seo.html tech
 
PDF
The Convergence of Threat Behaviors Across Intrusions
Joe Slowik
 
PPTX
美国电子毕业证帕克大学电子版成绩单UMCP学费发票办理学历认证
Taqyea
 
PPTX
Class_4_Limbgvchgchgchgchgchgcjhgchgcnked_Lists.pptx
test123n
 
PPTX
原版一样(毕业证书)法国蒙彼利埃大学毕业证文凭复刻
Taqyea
 
PDF
Empowering Local Language Email with IDN & EAI – Powered by XgenPlus
XgenPlus Technologies
 
PDF
ContextForge MCP Gateway - the missing proxy for AI Agents and Tools
Mihai Criveti
 
PPTX
Lesson 1.1 Career-Opportunities-in-Ict.pptx
lizelgumadlas1
 
PDF
Learning Exemplar_Technology and Livelihood Education 7 Q1_W2.pdf
mjhiludo16
 
PPTX
My Mother At 66! (2).pptx00000000000000000000000000000
vedapattisiddharth
 
PDF
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
PDF
Beginning-Laravel-Build-Websites-with-Laravel-5.8-by-Sanjib-Sinha-z-lib.org.pdf
TagumLibuganonRiverB
 
PPTX
Introduction-to-the-AWS-Solution-Architect.pptx
Prince391830
 
PDF
Strategic Plan New and Completed Templeted
alvi932317
 
PDF
google promotion services in Delhi, India
Digital Web Future
 
PDF
AI security AI security AI security AI security
elite44
 
PPTX
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
Ransomware attack and its effects on cyber crimes
ShilpaShreeD
 
CHAPTER 1 - PART 3 FOR GRADE 11 STUDENTS
FSBTLEDNathanVince
 
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
web application development company in bangalore.pdf
https://dkpractice.co.in/seo.html tech
 
The Convergence of Threat Behaviors Across Intrusions
Joe Slowik
 
美国电子毕业证帕克大学电子版成绩单UMCP学费发票办理学历认证
Taqyea
 
Class_4_Limbgvchgchgchgchgchgcjhgchgcnked_Lists.pptx
test123n
 
原版一样(毕业证书)法国蒙彼利埃大学毕业证文凭复刻
Taqyea
 
Empowering Local Language Email with IDN & EAI – Powered by XgenPlus
XgenPlus Technologies
 
ContextForge MCP Gateway - the missing proxy for AI Agents and Tools
Mihai Criveti
 
Lesson 1.1 Career-Opportunities-in-Ict.pptx
lizelgumadlas1
 
Learning Exemplar_Technology and Livelihood Education 7 Q1_W2.pdf
mjhiludo16
 
My Mother At 66! (2).pptx00000000000000000000000000000
vedapattisiddharth
 
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
Beginning-Laravel-Build-Websites-with-Laravel-5.8-by-Sanjib-Sinha-z-lib.org.pdf
TagumLibuganonRiverB
 
Introduction-to-the-AWS-Solution-Architect.pptx
Prince391830
 
Strategic Plan New and Completed Templeted
alvi932317
 
google promotion services in Delhi, India
Digital Web Future
 
AI security AI security AI security AI security
elite44
 
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 

10- Learn CSS Fundamentals / Pseudo-elements

  • 1. IN A ROCKET Learn front-end development at rocket speed CSS CSS FUNDAMENTALS Pseudo-element
  • 2. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com “Pseudo-elements create abstractions about the document tree beyond those specified by the document language. They may also provide authors a way to refer to content that does not exist in the source document.” SOURCE: Selectors Level 3 by W3C.
  • 3. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Pseudo-elements ::first-letter ::first-line ::before ::after
  • 4. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com PSEUDO-ELEMENTS / FIRST-LETTER With this code the first letter of all paragraphs is shown in green. Represents the first letter of an element, if it is not preceded by any other content on its line. p::first-letter {color: green} Syntax selector::first-letter {style properties}
  • 5. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser PSEUDO-ELEMENTS / FIRST-LETTER <body> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur eveniet dicta, deleniti eos.</p> <p>Debitis vitae minus magnam quod porro numquam officia! Natus, culpa tenetur.</p> </body> p::first-letter { color: red; } Web page title index.html Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur eveniet dicta, deleniti eos. Debitis vitae minus magnam quod porro numquam officia! Natus, culpa tenetur. READY TO USE CODE
  • 6. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Pseudo-elements ::first-letter ::first-line ::before ::after
  • 7. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com PSEUDO-ELEMENTS / FIRST-LINE With this code the first line of all paragraphs is shown in green. Describes the contents of the first formatted line of an element. p::first-line {color: green} Syntax selector::first-line {style properties}
  • 8. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser PSEUDO-ELEMENTS / FIRST-LINE <body> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur eveniet dicta, deleniti eos.</p> <p>Debitis vitae minus magnam quod porro numquam officia! Natus, culpa tenetur.</p> </body> p::first-line { color: green; } Web page title index.html Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur eveniet dicta, deleniti eos. Debitis vitae minus magnam quod porro numquam officia! Natus, culpa tenetur. READY TO USE CODE
  • 9. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Pseudo-elements ::first-letter ::first-line ::before ::after
  • 10. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com PSEUDO-ELEMENTS / BEFORE With this code all paragraphs are preceded by "★". Describes generated content before an element’s content. p::before {content: "★"} Syntax selector::before {style properties}
  • 11. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser PSEUDO-ELEMENTS / BEFORE <body> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur eveniet dicta, deleniti eos.</p> <p>Debitis vitae minus magnam quod porro numquam officia! Natus, culpa tenetur.</p> </body> p::before { content: "★"; } Web page title index.html ★ Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequuntur eveniet dicta, deleniti eos. ★ Debitis vitae minus magnam quod porro numquam officia! Natus, culpa tenetur. READY TO USE CODE
  • 12. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com Pseudo-elements ::first-letter ::first-line ::before ::after
  • 13. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com PSEUDO-ELEMENTS / AFTER With this code all paragraphs are finished with ✔. Describes generated content after an element’s content. p::after {content: "✔"} Syntax selector::after {style properties}
  • 14. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser PSEUDO-ELEMENTS / AFTER <body> <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> </body> li::after { content: "✔"; } Web page title index.html • Item 1 ✔ • Item 2 ✔ • Item 3 ✔ READY TO USE CODE
  • 15. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com HTML CSS Browser PSEUDO-ELEMENTS / BEFORE + AFTER <body> <q>To be, or not to be,</q> Shakespeare said, <q>that is the question.</q> </body> q::before { content: "“"; } q::after { content: "”"; } Web page title index.html “To be, or not to be,” Shakespeare said, “that is the question.” READY TO USE CODE
  • 16. CSS FUNDAMENTALS: Build a strong foundation by solving real cases inarocket.com REFERENCE: W3C SOURCE: Selectors Level 3 by W3C.
  • 17. 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
  • 18. 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
  • 19. IN A ROCKET Learn front-end development at rocket speed CSS CSS FUNDAMENTALS Pseudo-element