Embarrassed to ask this... (css selector)

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

I want to change the styles of all the h6 and p elements in the tips list without specifying the list item's id. So what selector do I use in my CSS?

<ul id="tips">
  <li id="some-id">
    <h6>This is a tip</h6>
    <p>This is a test tip</p>
  </li>
  <li id="some-other-id">
    <h6>This is a tip</h6>
    <p>This is a test tip</p>
  </li>
</ul>

I'm stumped.

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

Nevermind. My javascript just wasn't applying the style. Doh!

ul#tips p

ul#tips h6

would work just fine.

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

matt,

for times like this, I have discovered the Doh! smiley:

Doh!

: DOH :

(without the spaces...)

greg's picture

He has: 1,581 posts

Joined: Nov 2005

And would you say you use it a lot?

Sticking out tongue

decibel.places's picture

He has: 1,494 posts

Joined: Jun 2008

yes I use it often...

teammatt3's picture

He has: 2,102 posts

Joined: Sep 2003

I didn't even know about that smiley Doh!!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.