How to Use CSS Pseudo-Classes

  Рет қаралды 1,737

Craig A. Bourne

Craig A. Bourne

Күн бұрын

► Pseudo-classes specify a unique state of the element that has been triggered due to user interaction.
A common pseudo-class that we are all familiar with is the :hover.
Our pages will usually be full of links and buttons for users to click, and we would ordinarily set separate styles that only come in to force when the user hovers their cursor over the element. This change in styles informs the user that the element is interactive and can be clicked.
For example - a:hover { }
In this video, we will look at the :hover pseudo-class, plus
:visited
:link
:root
:first-child
:last-child
:first-of-type
:last-of-type
:nth-child() + nth term, and odd & even keywords
:disabled
:checked
:required
:not ( )
In addition to these, we will discuss visited links and privacy, and take a brief look at the CSS concept of specificity.
► Timestamps:
0:00 Start
1:49 - GitHub Repo
2:06 - CodePen
2:55 - :hover
5:49 - :visited & link
7:14 - Privacy and the :visited selector:
8:45 - :root
10:09 - Brief word on specificity
12:35 - :first-child & :last-child
13:40 - :first-of-type & :last-of-type
17:03 - :nth-child()
19:50 - :nth-child() - odd & even keywords
20:36 - Using :nth-child() to style table rows
21:00 - :disabled
22:42 - :checked
23:24 :required
24:00 Negation :not()
► Get the code:
GitHub Repo: github.com/craigabourne/css-p...
CodePen Start: codepen.io/craigabourne/pen/Z...
CodePen End: codepen.io/craigabourne/pen/V...
Code Pen Even/Odd: codepen.io/craigabourne/pen/x...
CodePen :not(): codepen.io/craigabourne/pen/x...
Nth-child table row: codepen.io/craigabourne/pen/x...
► Links used in the video:
MDN Selectors: developer.mozilla.org/en-US/d...
MDN Pseudo Classes: developer.mozilla.org/en-US/d...
Privacy and the :visited selector: developer.mozilla.org/en-US/d...
CSS Specificity: css-tricks.com/specifics-on-c...
► Other types of CSS Selectors:
Element, Class, & ID Selectors: • CSS Selector Basics - ...
Child & Descendant Selectors: • CSS Child and Descenda...
Sibling Selectors: • Adjacent and General S...
Universal & Attribute Selectors: • Universal and Attribut...
Pseudo-elements: • How to Manipulate Cont...
► This video is part of the CSS for Absolute Beginners playlist: • CSS for Absolute Begin...
► Social Media:
/ craigabourne
/ craigabourne
► Code & Projects:
github.com/craigabourne
codepen.io/craigabourne

Пікірлер: 21
@craigabourne
@craigabourne 3 жыл бұрын
Learn CSS: kzbin.info/aero/PL4cTxE4s2XIYwGURywyDlkfmhmRC5FaUR
@shilohdalby8447
@shilohdalby8447 2 жыл бұрын
I lay my mark here, the best pseudo class tutorial on youtube
@craigabourne
@craigabourne 2 жыл бұрын
Thank you 🙏
@georgeepohcuaw2545
@georgeepohcuaw2545 2 жыл бұрын
Totally new perspective on pseudo classes. Thx a ton.
@craigabourne
@craigabourne 2 жыл бұрын
You're welcome!
@marinstrup
@marinstrup 2 жыл бұрын
Thank you so much! Your video is exactly what I need as I just started with CSS. You have the best videos. Keep it up!
@craigabourne
@craigabourne 2 жыл бұрын
Thanks, will do!
@besjanaelezi
@besjanaelezi 3 жыл бұрын
Thanks Craig, I would like to make 100 likes but not possible 😍 You have build a trust over your videos. I would always search in your channel better than Google. Even if i use google, I type your name to check your contents which are better than others. Keep up amazing work 👍
@craigabourne
@craigabourne 3 жыл бұрын
Wow, thank you! Love it. Means a lot ❤️
@somnarchaudhary
@somnarchaudhary 3 жыл бұрын
Ah man. This is sooo good. You are genuinely one of the best actual teachers in the code space. Wishing big things for you. Every video is fire
@craigabourne
@craigabourne 3 жыл бұрын
Wow, thank you! Really appreciate it.
@balaeinstein8710
@balaeinstein8710 3 жыл бұрын
This css content is phenomenal . Thanks a lot sir. Please continue this series
@craigabourne
@craigabourne 3 жыл бұрын
Thanks, I really appreciate it! There will be around 40 CSS vids in total eventually 👍
@balaeinstein8710
@balaeinstein8710 3 жыл бұрын
@@craigabourne eagerly waiting sir😊
@kajabrooks
@kajabrooks 3 жыл бұрын
Amazing again! Keep going 👍
@craigabourne
@craigabourne 3 жыл бұрын
Thank you! Will do!
@gambo2003
@gambo2003 3 жыл бұрын
Thank u for the amazing content
@craigabourne
@craigabourne 3 жыл бұрын
My pleasure!
@sophiawokoma3711
@sophiawokoma3711 2 жыл бұрын
I was wondering if you could help, I downloaded the file into vs code , but for some reasons any changes that I make in the start code for the pseudo.css, does not display in the browser , what reasons could there be for this ?
@craigabourne
@craigabourne 2 жыл бұрын
Hi Sophie! That is strange. I have just tried it myself and it is working fine for me. The only thing I can think of is that you are not refreshing the browser after making a change. You can get a great extension in VS Code called Live Server that does this automatically for you (marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer or just search 'live server' in the extension tab in VS Code). To make it work, add the extension, then right-click your index.html file and select 'Open with Live Server'. It will open in your default browser. Then any change you make will be automatically shown. Hope that helps! If not let me know.
@ovidiu2394
@ovidiu2394 2 жыл бұрын
:hi
How to Manipulate Content With CSS Pseudo-Elements
16:27
Craig A. Bourne
Рет қаралды 2,2 М.
Universal and Attribute Selectors in CSS
17:53
Craig A. Bourne
Рет қаралды 1,6 М.
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 17 МЛН
🌊Насколько Глубокий Океан ? #shorts
00:42
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 19 МЛН
The joker's house has been invaded by a pseudo-human#joker #shorts
00:39
Untitled Joker
Рет қаралды 13 МЛН
CSS Specificity
23:06
Craig A. Bourne
Рет қаралды 2,1 М.
CSS Selector Basics - Element, Class, and ID
32:14
Craig A. Bourne
Рет қаралды 3,2 М.
Ems & Rems: How to use CSS Units
13:51
Craig A. Bourne
Рет қаралды 2,3 М.
Adjacent and General Sibling Selectors in CSS
16:45
Craig A. Bourne
Рет қаралды 2,2 М.
Mastering CSS Positioning Once and For All
22:12
Craig A. Bourne
Рет қаралды 9 М.
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Software Developer Diaries
Рет қаралды 71 М.
The Story of Next.js
12:13
uidotdev
Рет қаралды 551 М.
The ARCH LINUX Experience
34:30
Bog
Рет қаралды 112 М.
CSS Resets and Default Browser Styles
16:01
Craig A. Bourne
Рет қаралды 3,3 М.
Learn Emmet In 15 Minutes - Double Your HTML Coding Speed
15:27
Web Dev Simplified
Рет қаралды 204 М.
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 28 МЛН
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,4 МЛН
cute mini iphone
0:34
승비니 Seungbini
Рет қаралды 5 МЛН
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 3,3 МЛН