Combining and Chaining CSS Selectors

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-Nash4 жыл бұрын

    You are the Bob Ross of CSS and HTML. Beautifully done.

  • @FelipeGanash

    @FelipeGanash

    2 жыл бұрын

    This is sooo true! Thanks for the video

  • @wuersen

    @wuersen

    9 ай бұрын

    Soooo true!!!

  • @shady7117
    @shady71173 жыл бұрын

    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

  • @dotterel
    @dotterel Жыл бұрын

    Dude, this is such an amazing teaching style. 10/10, would recommend.

  • @Hydrogenpipes
    @Hydrogenpipes5 жыл бұрын

    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

  • @debhasish
    @debhasish2 жыл бұрын

    You have basically broken my 5 years of misconception on CSS chaining. I am very lucky to have this video Great Job :) 👍

  • @thenishantgiri
    @thenishantgiri Жыл бұрын

    I have watched many videos of yours sir, Helped a-lot! Keep spreading your knowledge sir. Love from Nepal 🇳🇵

  • @thetowerfantasymusic
    @thetowerfantasymusic4 жыл бұрын

    Calm and clear explanations, best i've seen. Subbed

  • @alexanderkorotkoff2639
    @alexanderkorotkoff26392 жыл бұрын

    Thank you Steve, it is explained in a very simple and understandable way!

  • @zeusifyhosting8042
    @zeusifyhosting8042 Жыл бұрын

    Beautifully detailed tutorial!

  • @shivaEEE
    @shivaEEE Жыл бұрын

    Finally peace after searching lots of videos 🥹👐

  • @rupambhattacharyya780
    @rupambhattacharyya7802 жыл бұрын

    awesome explanation...!!!!! i was searching for this tutorial in youtube and you explained fabulously

  • @CK-ne5hp
    @CK-ne5hp4 жыл бұрын

    Well explained! I always mix up the different rules and exceptions. Thanks for explaining it so calmly!

  • @hashirkhattak9180
    @hashirkhattak91802 жыл бұрын

    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

  • @kierangarvey6303
    @kierangarvey63032 жыл бұрын

    Love your teaching style. Subscribed and look forward to watching many more.

  • @ikechukwualita521
    @ikechukwualita5212 жыл бұрын

    Have been looking for this for long. Thanks for the idea

  • @MrDiabeu
    @MrDiabeu5 жыл бұрын

    excellent tutorial! you've got no idea how much it helped me. thank you!

  • @samirsamir7779
    @samirsamir77794 жыл бұрын

    this is what I call : THE PEDAGOGIC EXPLANATIONS ! thanks ;)

  • @koul_2482
    @koul_24824 ай бұрын

    thank you!! I was confused in class but this video cleared it up!

  • @darkpixie34
    @darkpixie344 жыл бұрын

    Such a great explanation! Thank you! :) Very, very helpful and straightforward.

  • @andriykupinskyy4700
    @andriykupinskyy4700 Жыл бұрын

    Best explanation I found. Thank you!

  • @nageswarkv
    @nageswarkv4 жыл бұрын

    Very good explanation without any fluff!!

  • @dante2047
    @dante20473 жыл бұрын

    Thank you so much for your video on combining css. I’ve been struggling for too long.

  • @2primateswalkintoabar61
    @2primateswalkintoabar612 жыл бұрын

    Well articulated. Much obliged.

  • @vigneshwarm
    @vigneshwarm5 жыл бұрын

    This is the best explanation in the entire youtube!

  • @emanuelrouse7076
    @emanuelrouse70766 жыл бұрын

    Very simple explanation of specificity. Thanks.

  • @adriant2533
    @adriant25333 жыл бұрын

    Superb explanation....very clear, concise....so much here in so little time--- would take most much longer to convey. Great!

  • @andriskatkovskis5758
    @andriskatkovskis57583 жыл бұрын

    clear and brilliant !

  • @Mado44555
    @Mado4455510 ай бұрын

    easy and direct to the point

  • @petersorger5231
    @petersorger52314 жыл бұрын

    great, this is what I needed to hear. Nice.

  • @juanreyes5238
    @juanreyes52385 жыл бұрын

    Great explanation man, how great

  • @sane4959
    @sane49594 жыл бұрын

    I don't know why your voice is just so relaxing! 😅😂

  • @feis._.
    @feis._. Жыл бұрын

    Thank you SO MUCH, now I can understand a lot more!

  • @mohamed.alesawii
    @mohamed.alesawii3 жыл бұрын

    Really thanks alot i appreciate your great point of view in teaching the "css chaining" may god bless you ☺

  • @igorr4682
    @igorr46825 жыл бұрын

    nice and clear, good job

  • @michealowen8144
    @michealowen81442 жыл бұрын

    Thank You for the explanation

  • @ramyhaaselvaraj9243
    @ramyhaaselvaraj92434 жыл бұрын

    Great video .... Thanks a lot .. Appreciating ur work

  • @mortenlund1418
    @mortenlund14183 жыл бұрын

    ok nice video - you have complete control over this chapter - thanks.

  • @johnavernia1026
    @johnavernia1026 Жыл бұрын

    This is such a good video.

  • @abdelrahman5094
    @abdelrahman50945 жыл бұрын

    your explanation is extremely clear and helpful thank you

  • @SteveGriffith-Prof3ssorSt3v3

    @SteveGriffith-Prof3ssorSt3v3

    5 жыл бұрын

    Thanks

  • @nirmalmaharjan1748
    @nirmalmaharjan17483 жыл бұрын

    thanks .Great Explanation!!!!!

  • @koul_2482
    @koul_24825 ай бұрын

    thank you for the information!

  • @raavi2945
    @raavi29452 жыл бұрын

    Thanks Steve

  • @taylorb2783
    @taylorb2783 Жыл бұрын

    so helpful.. Thanks!

  • @SachinYadav-zp8ud
    @SachinYadav-zp8ud5 жыл бұрын

    great explanation :)

  • @asfandyar_ali
    @asfandyar_ali3 жыл бұрын

    Excellent thank you...

  • @yapchenpo95
    @yapchenpo953 жыл бұрын

    Perfect!

  • @vedinak7360
    @vedinak7360 Жыл бұрын

    Thank you!

  • @mdarif2835
    @mdarif28353 жыл бұрын

    Thank you so much sir, you explain very well.

  • @malekalshemali1125
    @malekalshemali11253 жыл бұрын

    unbelievable!

  • @xXSolidxXSn4k3xX
    @xXSolidxXSn4k3xX5 жыл бұрын

    wow too good sir

  • @yomama847
    @yomama8474 жыл бұрын

    Never thought someone in software could appreciate The Trailer Park Boys like me.... You have proved me wrong! haha... great vid!

  • @cferdinandi
    @cferdinandi4 жыл бұрын

    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!

  • @rahmaadel2546
    @rahmaadel25464 жыл бұрын

    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.

  • @anurajms
    @anurajms Жыл бұрын

    ty

  • @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
    @wuersen9 ай бұрын

    Amazing video 0:11

  • @BezzantSam
    @BezzantSam2 жыл бұрын

    Respect for the trailer park boys reference

  • @BezzantSam

    @BezzantSam

    2 жыл бұрын

    I met ricky and bubbles in 2010 in Portland I was so stoked

  • @farhadcohan8867
    @farhadcohan88675 ай бұрын

    👍 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

    5 ай бұрын

    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.

  • @cathaldolan7113
    @cathaldolan71134 жыл бұрын

    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

  • @westfield90
    @westfield903 жыл бұрын

    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.

  • @beenmicrophone5817
    @beenmicrophone58173 жыл бұрын

    fred ricky bubbles and julian. hahaha amazing

  • @SP-iv2jj
    @SP-iv2jj4 жыл бұрын

    I love Canadians!

  • @kushalshukla1323
    @kushalshukla13233 жыл бұрын

    now i'm feel better

  • @AK-my9sb
    @AK-my9sb8 ай бұрын

    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

    8 ай бұрын

    CSS Specificity - kzread.info/dash/bejne/fa6TtZaHm5fXqaw.html

  • @talkliberia812
    @talkliberia8122 жыл бұрын

    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 - kzread.info/dash/bejne/fa6TtZaHm5fXqaw.html

  • @ecerejo
    @ecerejo3 жыл бұрын

    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

  • @m.dvenkatesh7718
    @m.dvenkatesh77182 жыл бұрын

    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. kzread.info/dash/bejne/fa6TtZaHm5fXqaw.html

  • @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.

  • @ladylinkon3916
    @ladylinkon39164 жыл бұрын

    "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 :)

  • @silvo9460
    @silvo9460 Жыл бұрын

    @6:36 hahaa trailer park boys??

  • @yarik83men51
    @yarik83men514 жыл бұрын

    +++

  • @suneelvarma4821
    @suneelvarma48214 жыл бұрын

    He hates Bobby.

  • @tomwilliamson3637
    @tomwilliamson36373 жыл бұрын

    Trailer Park CSS lol

  • @nicolaregiacorte8328
    @nicolaregiacorte83284 жыл бұрын

    Thank you!