0

What do the > mean in CSS, i didnt see in the tutorial, but see it in some code.

24th Nov 2016, 11:10 PM
Michael Emerick
Michael Emerick - avatar
3 odpowiedzi
+ 2
In CSS the '>' symbol is used to indicate direct inclusion. For instance, the '.a > p' selector will only select 'p' tags whose first parent is of class 'a'.
24th Nov 2016, 11:59 PM
Arthur Busser
Arthur Busser - avatar
0
div > a This means the 'a' is the immediate child descendant of 'div' on a first level. Or to say it in another way. The 'a' tag is a direct child of 'div'. However, if the 'a' tag is inside a 'p' tag which is also inside the 'div' tag, the selector will not work because the 'a' tag becomes a grand child of div and a also is a direct child of 'p'. This will become p > a
25th Nov 2016, 12:36 AM
Marcz
0
Thanks!
25th Nov 2016, 2:30 AM
Michael Emerick
Michael Emerick - avatar