Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

CSS Selction Help - I can only modify the class on parent of parent element. ie div.thisclass > div > h3

I only have access to the class of 2 elements up and need to target the H3 element without interfering with existing styles.

I need to style that H3 as an override to existing styles - how can i do this with advanced CSS selectors

    <div class="Can-Access">
     <div class="cant-modify">
         <img></img>
          <span></span>
          <h3 class="cant-modify-either"></h3>
     </div>
    </div>

1 Answer

It could be as simple as

.Can-Access h3 { ... }

Or you can be more specific if you know the classname of the h3 element.