Title: Widget css
Last modified: August 20, 2016

---

# Widget css

 *  Resolved [broadleon](https://wordpress.org/support/users/broadleon/)
 * (@broadleon)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/widget-css/)
 * Hi
 * I have two widgets, but they both share
 *     ```
       .widget-content { padding-top:60px; padding-left:40px; }
       ```
   
 * Categories is off alignment because of its own css styling, is there a way to
   asign the categories widget a separate widget css
 *     ```
       .widget-content2 { padding-top:60px; padding-left:10px; }
       ```
   
 * Thanks in Advance

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/widget-css/#post-2341825)
 * some themes add an individual css id (individual to each widget) and a css class(
   specific to a widget type) to the widget code;
 * this is done by the way ‘register_sidebar()’ is used in functions.php of the 
   theme: [http://codex.wordpress.org/Function_Reference/register_sidebar](http://codex.wordpress.org/Function_Reference/register_sidebar)
   `'
   before_widget' => '<li id="%1$s" class="widget %2$s">',` (your theme might be
   different)
 * this would give you the specific css class to target the category widget.
 * if you need more detailed help, please post a link to your site.
 *  Thread Starter [broadleon](https://wordpress.org/support/users/broadleon/)
 * (@broadleon)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/widget-css/#post-2341833)
 * Hi thanks
 * That looks a little complicated,
 * [My Site](http://www.thebookboutique.co.uk)
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/widget-css/#post-2341838)
 * open functions.php of your theme and search for `register_sidebar(`
 * in that section, there might be a line:
 *     ```
       'before_widget' => '<div class="widget">',
       ```
   
 * try and change that to:
 *     ```
       'before_widget' => '<div class="widget %2$s">',
       ```
   
 * the changes should output a widget specific css class, which you should be able
   to use in your css;
    probably, example:
 * `.widget_categories .widget-content { padding-top:60px; padding-left:10px; }`
 * (instead of your `.widget-content2 { padding-top:60px; padding-left:10px; }` )
 *  Thread Starter [broadleon](https://wordpress.org/support/users/broadleon/)
 * (@broadleon)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/widget-css/#post-2341855)
 * Sorry but there’s no
 * > register_sidebar(
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/widget-css/#post-2341860)
 * > That looks a little complicated,
 * you are possibly right.
 * you might need to ask the theme’s vendor for support –
 * helping with a commercial theme is virtually impossible as there is no free access
   to the theme templates.
 *  Thread Starter [broadleon](https://wordpress.org/support/users/broadleon/)
 * (@broadleon)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/widget-css/#post-2341900)
 * Yep The “theme’s vendor” are really no that brilliant either, But I will give
   it a go.
 * But I’ve got theme issues with the css and internet explorer as well to sort 
   out now.
 * In firefox my theme looks good. in internet explorer my site looks like a bomb
   as hit it. (no really it’s a mess beyond recognition)
 * how i’am going to sort it, I really don’t know

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

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [broadleon](https://wordpress.org/support/users/broadleon/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/widget-css/#post-2341900)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
