Title: CSS hierarchy selector problem
Last modified: August 19, 2016

---

# CSS hierarchy selector problem

 *  [decimal](https://wordpress.org/support/users/decimal/)
 * (@decimal)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/css-hierarchy-selector-problem/)
 * I’m designing a wordpress theme for general use, all text links have a border-
   bottom applied on the hover state. When an image is placed into the post, it 
   inherits this state, which I obviously do not want.
 * This only occurs when an unaligned image is placed in the post. Aligned right,
   left & centered images are placed in a div, unaligned images are placed in the
   p tag by default.
 * I can’t access this unaligned image through CSS, here’s the HTML hierarchy when
   an image is posted….
 *     ```
       <div class="the-post">
       <p>
       <a href="image.jpg">
       <img class="gen-class-name" src="location">
       </a>
       </p>
       </div>
       ```
   
 * I’ve tired accessing it through CSS by a lot of different structures, i.e.
 *     ```
       a:hover img
       p a img:hover
       p img:hover
       .the-post p a img.class-name:hover
       ```
   
 * and set the border to 0.
    I’ve given up on the CSS as firebug is telling me the
   CSS is taking precedence, but it is still showing up. Is there a way of placing
   an unaligned image into a div without changing any core files (just theme filses)?

The topic ‘CSS hierarchy selector problem’ is closed to new replies.

## Tags

 * [border](https://wordpress.org/support/topic-tag/border/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [hover](https://wordpress.org/support/topic-tag/hover/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [selector](https://wordpress.org/support/topic-tag/selector/)

 * 0 replies
 * 1 participant
 * Last reply from: [decimal](https://wordpress.org/support/users/decimal/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/css-hierarchy-selector-problem/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
