6 CSS pseudo-elements every beginner should know 馃憞
::before ::after ::first-line ::first-letter ::marker ::selection
Small selectors, lots of design control.
Watch the full breakdown: youtu.be/hP6hoCVOWbs
#CSS #WebDevelopment #Frontend
Six CSS pseudo-elements.
Six simple ideas.
A lot of possibilities.
::before ::after ::first-line ::first-letter ::marker ::selection
youtu.be/hP6hoCVOWbs
#CSS #Frontend #Coding
Six CSS pseudo-elements.
Six simple ideas.
A lot of possibilities.
::before ::after ::first-line ::first-letter ::marker ::selection
youtu.be/hP6hoCVOWbs
#CSS #Frontend #Coding
CSS doesn't always need more HTML.
Sometimes the cleaner solution is a pseudo-element.
Before adding another element to your markup, ask yourself:
"Could CSS handle this?"
youtu.be/hP6hoCVOWbs
#CSS #CleanCode #WebDevelopment
CSS doesn't always need more HTML.
Sometimes the cleaner solution is a pseudo-element.
Before adding another element to your markup, ask yourself:
"Could CSS handle this?"
youtu.be/hP6hoCVOWbs
#CSS #CleanCode #WebDevelopment
::selection doesn't permanently change your text.
It only changes its appearance while the user has selected it.
That makes it perfect for small UX/design touches.
youtu.be/hP6hoCVOWbs
#CSS #UXDesign #WebDev
::selection doesn't permanently change your text.
It only changes its appearance while the user has selected it.
That makes it perfect for small UX/design touches.
youtu.be/hP6hoCVOWbs
#CSS #UXDesign #WebDev
Leta retweeted
light-dark() has worked in every major browser for a couple of years, but is often missed by developers and is a handy CSS function to use.
It picks a light or dark color from the page's color-scheme, so a theme toggle only has to flip color-scheme on the root.
One of my favorite things about ::first-line:
You don't manually define which words are part of the line.
The browser handles it based on the available space.
youtu.be/hP6hoCVOWbs
#CSS #WebDevelopment #Frontend
One of my favorite things about ::first-line:
You don't manually define which words are part of the line.
The browser handles it based on the available space.
youtu.be/hP6hoCVOWbs
#CSS #WebDevelopment #Frontend
Here's a useful CSS mental model:
::first-line cares about a line.
::first-letter cares about a letter.
The names are almost the documentation.
youtu.be/hP6hoCVOWbs
#CSS #CodingTips #LearnCSS
Here's a useful CSS mental model:
::first-line cares about a line.
::first-letter cares about a letter.
The names are almost the documentation.
youtu.be/hP6hoCVOWbs
#CSS #CodingTips #LearnCSS
A normal paragraph can become:
Big first letter. Styled first line. Custom selection colors.
All with CSS.
No complicated JavaScript required.
youtu.be/hP6hoCVOWbs
#CSS #WebDesign #FrontendDevelopment
A normal paragraph can become:
Big first letter. Styled first line. Custom selection colors.
All with CSS.
No complicated JavaScript required.
youtu.be/hP6hoCVOWbs
#CSS #WebDesign #FrontendDevelopment
If you're learning CSS, don't try to memorize everything.
Build a toolbox.
::before, ::after, ::first-line, ::first-letter, ::marker, and ::selection are six useful tools to add.
youtu.be/hP6hoCVOWbs
#CSS #LearnToCode #WebDevelopment
If you're learning CSS, don't try to memorize everything.
Build a toolbox.
::before, ::after, ::first-line, ::first-letter, ::marker, and ::selection are six useful tools to add.
youtu.be/hP6hoCVOWbs
#CSS #LearnToCode #WebDevelopment
CSS gets more interesting when you stop thinking only about elements.
You can target:
The first line
The first letter
The list marker
Selected text
That's the power of pseudo-elements.
youtu.be/hP6hoCVOWbs
#CSS #Frontend #Coding





