Why is the element green? [duplicate]

The second p isn’t :not(.classy) so it isn’t color: red. This means it still has its default colour, which is color: inherit. The body element is :not(p) so it is color: green. The second p therefore inherits the green colour from the body element. The developer tools in your browser would have told you this:

css :nth-child() :after

You can, but you are doing it wrong.. The issue that that all your p elements are inside li. So all of them are the first child of their li container. You will need to put the nth-child on the li elements. #id li:nth-child(1) p:after, #id li:nth-child(2) p:after, #id li:nth-child(3) p:after { content: ‘OM’; color: … Read more

select multiple child in css [closed]

You can separate the classes with a comma , .ListTaskTime tbody tr >td:nth-child(3), .ListTaskTime tbody tr >td:nth-child(6), .ListTaskTime tbody tr >td:nth-child(9) { /* Common Styles Goes Here, Styles will apply to child 3,6 and 9 */ } Note: You need to check the nth-child and define it manually in your stylesheet, as CSS cannot decide … Read more

I need to find an element in Selenium by CSS

Only using class names is not sufficient in your case. By.cssSelector(“.ban”) has 15 matching nodes By.cssSelector(“.hot”) has 11 matching nodes By.cssSelector(“.ban.hot”) has 5 matching nodes Therefore you need more restrictions to narrow it down. Option 1 and 2 below are available for CSS selector, 1 might be the one that suits your needs best. Option … Read more