Combining and Chaining CSS Selectors

  Рет қаралды 29,579

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

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.co...

Пікірлер: 98
@Oliver-Nash
@Oliver-Nash 5 жыл бұрын
You are the Bob Ross of CSS and HTML. Beautifully done.
@FelipeGanash
@FelipeGanash 2 жыл бұрын
This is sooo true! Thanks for the video
@wuersen
@wuersen 11 ай бұрын
Soooo true!!!
@thenishantgiri
@thenishantgiri Жыл бұрын
I have watched many videos of yours sir, Helped a-lot! Keep spreading your knowledge sir. Love from Nepal 🇳🇵
@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
@zeusifyhosting8042
@zeusifyhosting8042 Жыл бұрын
Beautifully detailed tutorial!
@dotterel
@dotterel Жыл бұрын
Dude, this is such an amazing teaching style. 10/10, would recommend.
@rupambhattacharyya780
@rupambhattacharyya780 2 жыл бұрын
awesome explanation...!!!!! i was searching for this tutorial in youtube and you explained fabulously
@ikechukwualita521
@ikechukwualita521 2 жыл бұрын
Have been looking for this for long. Thanks for the idea
@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 :) 👍
@andriykupinskyy4700
@andriykupinskyy4700 Жыл бұрын
Best explanation I found. Thank you!
@shivaEEE
@shivaEEE Жыл бұрын
Finally peace after searching lots of videos 🥹👐
@alexanderkorotkoff2639
@alexanderkorotkoff2639 2 жыл бұрын
Thank you Steve, it is explained in a very simple and understandable way!
@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
@koul_2482
@koul_2482 6 ай бұрын
thank you!! I was confused in class but this video cleared it up!
@thetowerfantasymusic
@thetowerfantasymusic 4 жыл бұрын
Calm and clear explanations, best i've seen. Subbed
@kierangarvey6303
@kierangarvey6303 2 жыл бұрын
Love your teaching style. Subscribed and look forward to watching many more.
@samirsamir7779
@samirsamir7779 4 жыл бұрын
this is what I call : THE PEDAGOGIC EXPLANATIONS ! thanks ;)
@2primateswalkintoabar61
@2primateswalkintoabar61 2 жыл бұрын
Well articulated. Much obliged.
@hashirkhattak9180
@hashirkhattak9180 3 жыл бұрын
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
@Mado44555
@Mado44555 Жыл бұрын
easy and direct to the point
@raavi2945
@raavi2945 2 жыл бұрын
Thanks Steve
@nageswarkv
@nageswarkv 4 жыл бұрын
Very good explanation without any fluff!!
@feis._.
@feis._. Жыл бұрын
Thank you SO MUCH, now I can understand a lot more!
@darkpixie34
@darkpixie34 4 жыл бұрын
Such a great explanation! Thank you! :) Very, very helpful and straightforward.
@CK-ne5hp
@CK-ne5hp 4 жыл бұрын
Well explained! I always mix up the different rules and exceptions. Thanks for explaining it so calmly!
@dante2047
@dante2047 3 жыл бұрын
Thank you so much for your video on combining css. I’ve been struggling for too long.
@andriskatkovskis5758
@andriskatkovskis5758 3 жыл бұрын
clear and brilliant !
@emanuelrouse7076
@emanuelrouse7076 6 жыл бұрын
Very simple explanation of specificity. Thanks.
@vigneshwarm
@vigneshwarm 5 жыл бұрын
This is the best explanation in the entire youtube!
@sane4959
@sane4959 4 жыл бұрын
I don't know why your voice is just so relaxing! 😅😂
@michealowen8144
@michealowen8144 2 жыл бұрын
Thank You for the explanation
@adriant2533
@adriant2533 3 жыл бұрын
Superb explanation....very clear, concise....so much here in so little time--- would take most much longer to convey. Great!
@BezzantSam
@BezzantSam 3 жыл бұрын
Respect for the trailer park boys reference
@BezzantSam
@BezzantSam 3 жыл бұрын
I met ricky and bubbles in 2010 in Portland I was so stoked
@MrDiabeu
@MrDiabeu 5 жыл бұрын
excellent tutorial! you've got no idea how much it helped me. thank you!
@johnavernia1026
@johnavernia1026 2 жыл бұрын
This is such a good video.
@nirmalmaharjan1748
@nirmalmaharjan1748 3 жыл бұрын
thanks .Great Explanation!!!!!
@yomama847
@yomama847 5 жыл бұрын
Never thought someone in software could appreciate The Trailer Park Boys like me.... You have proved me wrong! haha... great vid!
@koul_2482
@koul_2482 6 ай бұрын
thank you for the information!
@mohamed.alesawii
@mohamed.alesawii 3 жыл бұрын
Really thanks alot i appreciate your great point of view in teaching the "css chaining" may god bless you ☺
@petersorger5231
@petersorger5231 4 жыл бұрын
great, this is what I needed to hear. Nice.
@mortenlund1418
@mortenlund1418 3 жыл бұрын
ok nice video - you have complete control over this chapter - thanks.
@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!
@abdelrahman5094
@abdelrahman5094 5 жыл бұрын
your explanation is extremely clear and helpful thank you
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 5 жыл бұрын
Thanks
@taylorb2783
@taylorb2783 Жыл бұрын
so helpful.. Thanks!
@wuersen
@wuersen 11 ай бұрын
Amazing video 0:11
@asfandyar_ali
@asfandyar_ali 3 жыл бұрын
Excellent thank you...
@vedinak7360
@vedinak7360 Жыл бұрын
Thank you!
@yapchenpo95
@yapchenpo95 3 жыл бұрын
Perfect!
@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.
@igorr4682
@igorr4682 5 жыл бұрын
nice and clear, good job
@ramyhaaselvaraj9243
@ramyhaaselvaraj9243 4 жыл бұрын
Great video .... Thanks a lot .. Appreciating ur work
@juanreyes5238
@juanreyes5238 5 жыл бұрын
Great explanation man, how great
@malekalshemali1125
@malekalshemali1125 3 жыл бұрын
unbelievable!
@mdarif2835
@mdarif2835 3 жыл бұрын
Thank you so much sir, you explain very well.
@anurajms
@anurajms Жыл бұрын
ty
@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.
@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.
@farhadcohan8867
@farhadcohan8867 7 ай бұрын
👍 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 7 ай бұрын
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.
@SachinYadav-zp8ud
@SachinYadav-zp8ud 5 жыл бұрын
great explanation :)
@beenmicrophone5817
@beenmicrophone5817 3 жыл бұрын
fred ricky bubbles and julian. hahaha amazing
@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
@kushalshukla1323
@kushalshukla1323 3 жыл бұрын
now i'm feel better
@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
@SP-iv2jj
@SP-iv2jj 4 жыл бұрын
I love Canadians!
@AK-my9sb
@AK-my9sb 10 ай бұрын
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 10 ай бұрын
CSS Specificity - kzbin.info/www/bejne/gavChGeEoJmkr6s
@xXSolidxXSn4k3xX
@xXSolidxXSn4k3xX 5 жыл бұрын
wow too good sir
@jetspray3
@jetspray3 Жыл бұрын
The avatar for deadpool is not on your github.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
Nope.
@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 :)
@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 :)
@ecerejo
@ecerejo 4 жыл бұрын
Where is the CSS for the main.css file?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
It doesnt exist. The css for the tutorial is in the style element.
@ecerejo
@ecerejo 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Just asking because I see the link to it in your video.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
@@ecerejo I used to have my template starter page set up to include that link
@silvo9460
@silvo9460 Жыл бұрын
@6:36 hahaa trailer park boys??
@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
Рет қаралды 92 М.
CSS Selectors - beyond the very basics
18:47
Kevin Powell
Рет қаралды 42 М.
Шок. Никокадо Авокадо похудел на 110 кг
00:44
У ГОРДЕЯ ПОЖАР в ОФИСЕ!
01:01
Дима Гордей
Рет қаралды 8 МЛН
CSS Float and Clear Properties
10:48
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 33 М.
CSS Selectors Tutorial for Beginners
20:34
Dave Gray
Рет қаралды 50 М.
The new CSS pseudo-classes explained - :is() :where() :has()
13:50
Kevin Powell
Рет қаралды 137 М.
CSS nth child Selectors
12:38
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 19 М.
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 958 М.
Avoid These 5 Awful CSS Mistakes
20:42
Kevin Powell
Рет қаралды 193 М.
Learn Every CSS Selector In 20 Minutes
19:38
Web Dev Simplified
Рет қаралды 451 М.
10 CSS Pro Tips - Code this, NOT that!
9:39
Fireship
Рет қаралды 2,2 МЛН
Pseudo-Classes vs Pseudo-Elements in CSS
8:51
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 17 М.
Learn CSS Specificity In 11 Minutes
11:26
Web Dev Simplified
Рет қаралды 98 М.