Title: Problem with Sidebar CSS Properties&#8230;.
Last modified: August 22, 2016

---

# Problem with Sidebar CSS Properties….

 *  [Aryan](https://wordpress.org/support/users/muhammadadilnazir/)
 * (@muhammadadilnazir)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/problem-with-sidebar-css-properties/)
 * to show recent posts from specific category i am using following code.
 *     ```
       <strong><p class="recentheading">Latest Albums</p>
       <?php query_posts('showposts=5&cat=1'); ?>
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
   
       <span class="recentp">
   
       <ul>
               <a>">
       <li><?php the_title() ?></li>
       </a>
           </ul>
       </span>
       <?php endwhile; endif;
       wp_reset_query();
       ?></strong>
       ```
   
 * and it is generating a list and by css i want to add border to last item of list,
   but **problem is** that whenever i add css border to last item , it is applied
   to all list items ,,,, so can you guys give me code how to do that

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

 *  [Emil Uzelac](https://wordpress.org/support/users/emiluzelac/)
 * (@emiluzelac)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/problem-with-sidebar-css-properties/#post-5610851)
 *     ```
       your-class:last-item {
           border: none;
       }
       ```
   
 * Something like that 🙂
 *  Thread Starter [Aryan](https://wordpress.org/support/users/muhammadadilnazir/)
 * (@muhammadadilnazir)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/problem-with-sidebar-css-properties/#post-5610852)
 * i have tried
 * .class:last-child
 * but unfortunately thats not working
 *  [Bojan Radonic – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support4/)
 * (@wpmudev-support4)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/problem-with-sidebar-css-properties/#post-5610873)
 * Hey there Aryan,
 * Could you please provide a link to a page where you have this so I can take a
   look?
 * Best regards,
    Bojan

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

The topic ‘Problem with Sidebar CSS Properties….’ is closed to new replies.

## Tags

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

 * 3 replies
 * 3 participants
 * Last reply from: [Bojan Radonic – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support4/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/problem-with-sidebar-css-properties/#post-5610873)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
