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
4 Answers
+ 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".
+ 1
thanks Tom Shaver, now i can read my css, somehow it works, but i dont know why
thank you
0
No problem :) Is it a project here on SL?
0
no, i found tutorial on youtube, try to copy the tutorial, and i try make few change by myself, and here i am