Title: css target
Last modified: August 21, 2016

---

# css target

 *  [egilarntzen](https://wordpress.org/support/users/egilarntzen/)
 * (@egilarntzen)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/css-target/)
 * Can’t “target” this with my CSS. What am I doing wrong?
 *     ```
       section#section1 .section white ul li {
       	display:inline;
       	background-color:#CF6;
       }
       ```
   
 *     ```
       <section class="section white" id="section1">
                   <ul>
                   <li><h2>Section 1</h2></li>
                   <li><p>
                       ‘A fathomless and boundless deep,
                       There we wander, there we weep;
                       On the hungry craving wind
                       My Spectre follows thee behind.
                   </p></li>
                   </ul>
               </section>
       ```
   

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/css-target/#post-3986609)
 * Try this:
 *     ```
       section.#section1 ul li {
       	display:inline;
       	background-color:#CF6;
       }
       ```
   
 * If that does not work, please post a link to a page where this occurs.
 *  Thread Starter [egilarntzen](https://wordpress.org/support/users/egilarntzen/)
 * (@egilarntzen)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/css-target/#post-3986620)
 * [http://tomrerdahl.no/gabba/](http://tomrerdahl.no/gabba/)
 * hmm… didn’t work.
 *  Thread Starter [egilarntzen](https://wordpress.org/support/users/egilarntzen/)
 * (@egilarntzen)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/css-target/#post-3986736)
 * Ok got it working…
 * But its strange. I can’t target the title inside the
 *     ```
       <li>.
       ```
   
 * It works with
 *     ```
       article ul li {
       }
       ```
   
 * if the code is
 * `<li>title</li>`
    But if I want
 * `<li><h2>title</h2></li>`
    it doesnt work with:
 *     ```
       article ul li {
       }
       ```
   
 * Weird…
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/css-target/#post-3986746)
 * Have you tried targeting the h2 inside the li with CSS?
 * Unless you target the “h2” it probably won’t apply to the “`<h2>`“
    _[http://www.w3schools.com/cssref/css\_selectors.asp](http://www.w3schools.com/cssref/css_selectors.asp)
   [http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/](http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/)
 *  Thread Starter [egilarntzen](https://wordpress.org/support/users/egilarntzen/)
 * (@egilarntzen)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/css-target/#post-3986808)
 * I know, but if I for instance want a background color on the li, it should still
   work, no?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 10 months ago](https://wordpress.org/support/topic/css-target/#post-3986809)
 * This isn’t a normal situation because you’re manipulating how the ‘`h2`‘ is displayed
   _
   [http://stackoverflow.com/questions/7439820/why-is-my-background-color-not-showing-if-i-have-display-inline](http://stackoverflow.com/questions/7439820/why-is-my-background-color-not-showing-if-i-have-display-inline)_

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘css target’ is closed to new replies.

## Tags

 * [css issue](https://wordpress.org/support/topic-tag/css-issue/)

 * 6 replies
 * 3 participants
 * Last reply from: [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/css-target/#post-3986809)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
