skip to Main Content

enter image description here

I was requesting some help in combinators (combining selectors). I’m looking to use the same font in a paragraph element that has a list element in it. I have tried the child combinator >) and the next sibling combinator + still nothing.

I was expecting by using the child combinator > it will work since the list element is a child of the paragraph element and using the next sibling selector + too because it is.

2

Answers


  1. You can use the new :has child selector like

    p :has(ol)
    
    Login or Signup to reply.
  2. Try this:

    listclassname p {
      ### your styles here
      ### etc etc etc
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search