View Single Post
Old 12-30-2020, 10:38 PM   #5
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,589
Karma: 14328510
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by AlanHK View Post
But what does omitting the comma do?
Think of it as a descendant selector.
Code:
div p img { ... }
will match all img tags that are inside of p tags that are inside of div tags. Although the p could be inside of something else that's inside the div, likewise for the img; it's a descendant selector meaning the p could be a child, grandchild, great grandchild, etc. For immediate descendant (child) you'd use >;
Code:
div > p > img { ... }

Last edited by hobnail; 12-30-2020 at 10:43 PM.
hobnail is offline   Reply With Quote