John Sean John Sean - 1 year ago 66
CSS Question

Can someone describe this CSS selectors please?

Please give me a explanation on what this selectors do please:

  1. img[alt$="a"]

  2. li:odd p

  3. p:nth-child(2n +1)

  4. input:not([required])

  5. ul li.selected p::before

Answer Source

You should try googling a bit before you resolve to asking this kind of questions.


Selects every <img> element with alt attribute value ending with a

li:odd p

Selects every paragraph <p> under every odd <li>

p:nth-child(2n +1)

Selects every (2n+1)th paragraph


Selects every <input> element that's not required

ul li.selected p::before

Inserts something before the content of each <p> element under every <li> element with selected class

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download