Combining and Chaining CSS Selectors

  Рет қаралды 28,976

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

6 жыл бұрын

Did you know that you could add multiple CSS class names to any element?
Did you know that there is a way that you can specifically target elements that have multiple CSS classes?
Did you know that you could combine element names, class names, and ids to create better targeting for your styles?
Code GIST: gist.github.com/prof3ssorSt3v...

Пікірлер: 98
@Oliver-Nash
@Oliver-Nash 4 жыл бұрын
You are the Bob Ross of CSS and HTML. Beautifully done.
@FelipeGanash
@FelipeGanash 2 жыл бұрын
This is sooo true! Thanks for the video
@wuersen
@wuersen 8 ай бұрын
Soooo true!!!
@debhasish
@debhasish 2 жыл бұрын
You have basically broken my 5 years of misconception on CSS chaining. I am very lucky to have this video Great Job :) 👍
@dotterel
@dotterel Жыл бұрын
Dude, this is such an amazing teaching style. 10/10, would recommend.
@thetowerfantasymusic
@thetowerfantasymusic 4 жыл бұрын
Calm and clear explanations, best i've seen. Subbed
@shady7117
@shady7117 3 жыл бұрын
I've been up all night coding and completely forgot how to style a specific tag!! Thank God for you Steve man. Saved my life
@alexanderkorotkoff2639
@alexanderkorotkoff2639 2 жыл бұрын
Thank you Steve, it is explained in a very simple and understandable way!
@CK-ne5hp
@CK-ne5hp 4 жыл бұрын
Well explained! I always mix up the different rules and exceptions. Thanks for explaining it so calmly!
@Hydrogenpipes
@Hydrogenpipes 5 жыл бұрын
Hey Steve, actually I did not get to target the element I wanted, but I will see this video couple more times to get it under my skin. Also because clearness of your voice, man.. I can just listen to that all day. :) Thanks
@kierangarvey6303
@kierangarvey6303 2 жыл бұрын
Love your teaching style. Subscribed and look forward to watching many more.
@shivaEEE
@shivaEEE Жыл бұрын
Finally peace after searching lots of videos 🥹👐
@thenishantgiri
@thenishantgiri Жыл бұрын
I have watched many videos of yours sir, Helped a-lot! Keep spreading your knowledge sir. Love from Nepal 🇳🇵
@hashirkhattak9180
@hashirkhattak9180 2 жыл бұрын
This is an absolute treasure... Like a million dollars video... Damn man you got some serious skills to deliver the knowledge.. 🔥 lots of respect.. Subscribed and liked
@rupambhattacharyya780
@rupambhattacharyya780 2 жыл бұрын
awesome explanation...!!!!! i was searching for this tutorial in youtube and you explained fabulously
@darkpixie34
@darkpixie34 3 жыл бұрын
Such a great explanation! Thank you! :) Very, very helpful and straightforward.
@zeusifyhosting8042
@zeusifyhosting8042 Жыл бұрын
Beautifully detailed tutorial!
@MrDiabeu
@MrDiabeu 5 жыл бұрын
excellent tutorial! you've got no idea how much it helped me. thank you!
@ikechukwualita521
@ikechukwualita521 2 жыл бұрын
Have been looking for this for long. Thanks for the idea
@dante2047
@dante2047 3 жыл бұрын
Thank you so much for your video on combining css. I’ve been struggling for too long.
@nageswarkv
@nageswarkv 3 жыл бұрын
Very good explanation without any fluff!!
@emanuelrouse7076
@emanuelrouse7076 6 жыл бұрын
Very simple explanation of specificity. Thanks.
@adriant2533
@adriant2533 3 жыл бұрын
Superb explanation....very clear, concise....so much here in so little time--- would take most much longer to convey. Great!
@andriykupinskyy4700
@andriykupinskyy4700 Жыл бұрын
Best explanation I found. Thank you!
@vigneshwarm
@vigneshwarm 5 жыл бұрын
This is the best explanation in the entire youtube!
@koul_2482
@koul_2482 3 ай бұрын
thank you!! I was confused in class but this video cleared it up!
@mohamed.alesawii
@mohamed.alesawii 3 жыл бұрын
Really thanks alot i appreciate your great point of view in teaching the "css chaining" may god bless you ☺
@samirsamir7779
@samirsamir7779 4 жыл бұрын
this is what I call : THE PEDAGOGIC EXPLANATIONS ! thanks ;)
@2primateswalkintoabar61
@2primateswalkintoabar61 2 жыл бұрын
Well articulated. Much obliged.
@sane4959
@sane4959 4 жыл бұрын
I don't know why your voice is just so relaxing! 😅😂
@feis._.
@feis._. Жыл бұрын
Thank you SO MUCH, now I can understand a lot more!
@abdelrahman5094
@abdelrahman5094 5 жыл бұрын
your explanation is extremely clear and helpful thank you
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
Thanks
@juanreyes5238
@juanreyes5238 5 жыл бұрын
Great explanation man, how great
@ramyhaaselvaraj9243
@ramyhaaselvaraj9243 4 жыл бұрын
Great video .... Thanks a lot .. Appreciating ur work
@petersorger5231
@petersorger5231 4 жыл бұрын
great, this is what I needed to hear. Nice.
@Mado44555
@Mado44555 9 ай бұрын
easy and direct to the point
@mortenlund1418
@mortenlund1418 3 жыл бұрын
ok nice video - you have complete control over this chapter - thanks.
@andriskatkovskis5758
@andriskatkovskis5758 3 жыл бұрын
clear and brilliant !
@igorr4682
@igorr4682 5 жыл бұрын
nice and clear, good job
@michealowen8144
@michealowen8144 2 жыл бұрын
Thank You for the explanation
@johnavernia1026
@johnavernia1026 Жыл бұрын
This is such a good video.
@SachinYadav-zp8ud
@SachinYadav-zp8ud 5 жыл бұрын
great explanation :)
@nirmalmaharjan1748
@nirmalmaharjan1748 3 жыл бұрын
thanks .Great Explanation!!!!!
@mdarif2835
@mdarif2835 3 жыл бұрын
Thank you so much sir, you explain very well.
@koul_2482
@koul_2482 3 ай бұрын
thank you for the information!
@taylorb2783
@taylorb2783 Жыл бұрын
so helpful.. Thanks!
@raavi2945
@raavi2945 Жыл бұрын
Thanks Steve
@asfandyar_ali
@asfandyar_ali 3 жыл бұрын
Excellent thank you...
@cathaldolan7113
@cathaldolan7113 4 жыл бұрын
Hi Steve, I love your tutorials, they are really helpful. Thanks for taking the time out to do them. I have a query on this one. @7:41 you list out three classes with spaces between them. This doesn't have the desired affect. While you explain what is happening there, I don't understand why it doesn't work. Is it because the three classes are all on the same line and not nested in a parent/child relationship? The same principal I think applies at 10:20 where there is no space between the tag and the ID, and I'm wondering if this too is because they are on the same line. Thanks.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
If there is no space between two parts of the selector it means the same HTML element has to have both. Eg: #main.active would refer to something in the HTML like this .one.two.three means an HTML element like this
@yapchenpo95
@yapchenpo95 3 жыл бұрын
Perfect!
@cferdinandi
@cferdinandi 4 жыл бұрын
I really appreciate the use of rebeccapurple for a color value. ❤️
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
I love the fact that they did that for Eric.
@cferdinandi
@cferdinandi 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Same here!
@vedinak7360
@vedinak7360 Жыл бұрын
Thank you!
@xXSolidxXSn4k3xX
@xXSolidxXSn4k3xX 5 жыл бұрын
wow too good sir
@westfield90
@westfield90 3 жыл бұрын
Thank you so much. Always explained so well. What does it mean when you see the > symbol
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
That is the child selector. p > a { } means apply the style to anchors but only if they are direct children of a paragraph.
@malekalshemali1125
@malekalshemali1125 3 жыл бұрын
unbelievable!
@yomama847
@yomama847 4 жыл бұрын
Never thought someone in software could appreciate The Trailer Park Boys like me.... You have proved me wrong! haha... great vid!
@BezzantSam
@BezzantSam 2 жыл бұрын
Respect for the trailer park boys reference
@BezzantSam
@BezzantSam 2 жыл бұрын
I met ricky and bubbles in 2010 in Portland I was so stoked
@nft-discovery
@nft-discovery Жыл бұрын
Hello @steve griffith - Prof3ssorSt3v3, have you ever encountered a syntax problem error on VS Code with CSS element inside a CSS element as this : .card[data-state="#about"] { height: 450px; .card-main { padding-top: 0; } } the ".card-main" isn't recognized as an element class and I don't know what to do
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
You can't nest selectors inside other selectors in css.
@wuersen
@wuersen 8 ай бұрын
Amazing video 0:11
@farhadcohan8867
@farhadcohan8867 4 ай бұрын
👍 Steve can you explain differences on last part video #simon img and img , why do we needed to use id to style can just use img tag alone thank you
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 ай бұрын
img { } will apply to all images that are ever placed on the page. #simon img { } applies only to images that are inside an element with the id "simon". It is all about being more specific. Be as specific as you have to without creating really long selectors. html body main section p img#bob - targets an image with the id bob, if it is inside a paragraph, which is inside a section, which is inside a main, which is in the body, which is inside the html. It works. It is accurate. But really long and it would be slower to process. Instead just use img#bob or even #bob. Same element. Just as specific. Faster processing.
@rahmaadel2546
@rahmaadel2546 4 жыл бұрын
I have a question about last selector , in p img I don't see any change by these selector in the image
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
You would have to put some CSS inside the curly braces that you could see with an image. Something like border: 10px solid red; would show up.
@beenmicrophone5817
@beenmicrophone5817 3 жыл бұрын
fred ricky bubbles and julian. hahaha amazing
@anurajms
@anurajms Жыл бұрын
ty
@kushalshukla1323
@kushalshukla1323 3 жыл бұрын
now i'm feel better
@talkliberia812
@talkliberia812 2 жыл бұрын
I’m really having difficulty with styling in css. Most often my style will not take effect. Some will but not all
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
Most likely your problem is with specificity of your selectors - kzbin.info/www/bejne/gavChGeEoJmkr6s
@SP-iv2jj
@SP-iv2jj 4 жыл бұрын
I love Canadians!
@AK-my9sb
@AK-my9sb 7 ай бұрын
if classes and ids are important then why are they being applied after the html tags? also, what does that even mean?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 7 ай бұрын
CSS Specificity - kzbin.info/www/bejne/gavChGeEoJmkr6s
@m.dvenkatesh7718
@m.dvenkatesh7718 2 жыл бұрын
css compile from top to bottom ,second one will always override the first i guess ? but why it is not in the case body h1 colour is not changed to red?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 жыл бұрын
Top to bottom only matters if they have the same specificity. Specificity is the primary decider. kzbin.info/www/bejne/gavChGeEoJmkr6s
@m.dvenkatesh7718
@m.dvenkatesh7718 2 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thanks for Ur Quick Response and video clarifies my doubt :)
@jetspray3
@jetspray3 Жыл бұрын
The avatar for deadpool is not on your github.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
Nope.
@silvo9460
@silvo9460 Жыл бұрын
@6:36 hahaa trailer park boys??
@ecerejo
@ecerejo 3 жыл бұрын
Where is the CSS for the main.css file?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
It doesnt exist. The css for the tutorial is in the style element.
@ecerejo
@ecerejo 3 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Just asking because I see the link to it in your video.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
@@ecerejo I used to have my template starter page set up to include that link
@ladylinkon3916
@ladylinkon3916 4 жыл бұрын
"tag#id.class tag" doesn't work for me. How to make it work?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
Not sure what you have mistyped, but it will work. Here is an example codepen.io/mad-d/pen/MWKBwrZ
@ladylinkon3916
@ladylinkon3916 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Oh thanks, I just understood what the problem was. Thank you :)
@suneelvarma4821
@suneelvarma4821 4 жыл бұрын
He hates Bobby.
@tomwilliamson3637
@tomwilliamson3637 3 жыл бұрын
Trailer Park CSS lol
@yarik83men51
@yarik83men51 4 жыл бұрын
+++
@nicolaregiacorte8328
@nicolaregiacorte8328 4 жыл бұрын
Thank you!
How CSS Padding and Margin Works
6:54
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 90 М.
When to Use CSS Classes vs Ids
16:07
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 11 М.
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 32 МЛН
Пробую самое сладкое вещество во Вселенной
00:41
Children deceived dad #comedy
00:19
yuzvikii_family
Рет қаралды 6 МЛН
CSS Selectors - beyond the very basics
18:47
Kevin Powell
Рет қаралды 40 М.
CSS Selectors Tutorial for Beginners
20:34
Dave Gray
Рет қаралды 44 М.
CSS Float and Clear Properties
10:48
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 32 М.
Learn Every CSS Selector In 20 Minutes
19:38
Web Dev Simplified
Рет қаралды 439 М.
Avoid These 5 Awful CSS Mistakes
20:42
Kevin Powell
Рет қаралды 189 М.
11 Ways to Select Elements to Style in CSS
14:14
Deeecode The Web
Рет қаралды 874
CSS Selectors | CSS | Tutorial 12
9:12
Giraffe Academy
Рет қаралды 50 М.
Use Arc Instead of Vec
15:21
Logan Smith
Рет қаралды 137 М.
The new CSS pseudo-classes explained - :is() :where() :has()
13:50
Kevin Powell
Рет қаралды 131 М.
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 32 МЛН