0

What’s the Difference? (CSS Selector)

What's the difference between > .class element (with space) > element .class (with space) > element.class (with no space) can you explain how to read those selector in easy plain english (im not good in english)? thanks guys

1st Aug 2018, 11:26 PM
kei -san
kei -san - avatar
4 Respuestas
+ 3
element.class (no space) will find an element with class ".class". element .class (with space) will find any elements with class ".class" that are inside of any "element" elements. . class element (with space) will find any "element" elements inside of any element with class ".class". So, for the example: <div class="thing"> <b class="text">Hi</b> <span class="char">!</span> <div> .thing b - Would find the b element inside the div with class ".thing". div .char - Would find the span element with class ".char" inside the div element. b.text - Would find the b element with class ".text".
2nd Aug 2018, 12:01 AM
Tom Shaver
Tom Shaver - avatar
+ 1
thanks Tom Shaver, now i can read my css, somehow it works, but i dont know why thank you
2nd Aug 2018, 12:37 AM
kei -san
kei -san - avatar
0
No problem :) Is it a project here on SL?
2nd Aug 2018, 12:51 AM
Tom Shaver
Tom Shaver - avatar
0
no, i found tutorial on youtube, try to copy the tutorial, and i try make few change by myself, and here i am
2nd Aug 2018, 1:26 AM
kei -san
kei -san - avatar