DivitoDesign

Everything for the Web Professional

Style WordPress Widgets With CSS

Information about the Author:

Name:

URL: http://twitter.com/divitodesign

Description enjoy design, write articles, like typography, love football, keep chilling.

More on: Blogging

31 Comments

  1. daniel says:

    Stefan,

    Great Article, there are some great tips in there, I have subscribed to your RSS to get some more great stuff.

    Cheers

  2. Karen says:

    I’m having a tough time styling the text widget so there are no bullets. The URL is http://bodyjoy.org/blog

    I have edited the stylesheet with

    .textwidget li {
    list-style-type: none;
    list-style: none;

    }

    and many variations of it including

    .widget widget_text li {
    list-style-type: none;
    list-style: none;

    }

    #text-113273631 .widget .widget_text li {
    list-style-type: none;
    list-style: none;

    }

    Can you please guide me on what I should do differently? I’d also like the spacing to match the spacing of the submenus lower on the left nav.

    TIA!!!

  3. @Daniel – Hey Daniel. Thanks for your content and I have subscribed to your blog as well!

    @Karen – I think you have done it right. I don’t see the bullets, they are already removed. Did you fix it? :)

    Your other question: You should delete the spaces/dots and add padding-left:12px; to your ‘widget-text’ class. That should help you.

    If you have another question, let me know.

  4. nagi says:

    hey where to paste the HTML link in wordpress

  5. CSS + WP = :)

    WP really does have a certain elegant simplicity to it.

  6. @ A graphic designer – I agree, I agree. We all love WordPress :)

  7. Priscilla says:

    Your post is so far the most helpful one I have found on styling widgets, so thank you! However, I must be doing something wrong- I keep trying but I just can’t get my widgets to look properly. In fact, my changes have made them both pile up high at the top of the sidebar. The theme I am using is somewhat older and the widgets are completely unstyled, so I am adding style to them from scratch. I want them to look like the original sidebar looks (on my home page, it has been pushed down below the widgets, and they have been put side-by-side; I want to take out the old sidebar completely, but I am leaving it since I am asking for help.

    Do you have any suggestions for styling these widgets? I have tried simply pasting the sidebar style and then replacing “#sidebar” with permutations such as .widget, or with the name of the individual widgets, and all that happens is that they get crammed up by the top of the sidebar. Please help me if you can, and thank you!

  8. [...] Style wordpress widgets with CSS DivitoDesign – Webdesign BlogStyle WordPress Widgets. In this tutorial you will learn how to style wordpress widgets. A detailed article about how to style WordPress widgets. [...]

  9. Web Design says:

    You are so right wigets rock ! I am just coming to terms with them and this article as priscilla ( above ) said is very helpful. thankyou for giving back to the community.

  10. [...] lot more sidebars can be created and all the creativity that follows next, that’s up to you. Do you want to style your widgets now? Liked this post? Subscribe, or Share and [...]

  11. How can you have different styles per widget? For example, I want a specific style for my categories widget and another style for my recent posts widget…

  12. I don’t think I could stress enough how important it is for WP users to learn some PHP and XHTML. Yes, you can indeed pull off a bunch of cool things (such as styling the widgets) in WP. But, without a foundation of these two languages, you’re facing some serious problems. To the poster who asked how he/she could style individual widgets differently, I would recommend using the CCS “Class” tag. There are a bunch of sites online that elaborate on this topic, so you hopefully shouldn’t find much trouble in implemening it.

  13. LOL @ Dirty Blue Widgets, I’ll be your arch nemesis, the clean red widget…haha.

    I agree on learning PHP and HTML, especially HTML. It really isnt very hard to pick up and will make editing themes incredibly easier. PHP is a more difficult animal but still definitely worth learning once youve mastered HTML.

  14. I have just recently started learning PHP. I have a good freiend who does almost all my programming for me for a percentage, but I do think learning it will help my development.

    • Thanks for your comments “widgets” hehe. You are both right, learning XHTML/CSS is a must if you want to do something on the web. PHP however is not needed in my opinion, at least I don’t like it. :)

  15. WordPress is quickly becoming one of the best platforms to create any website, not just blogs. I just found out about the widgets, and couldn’t figure it out. Thanks for giving me just what i needed.

  16. KRCSC says:

    Hi, bit late to this… I’ve tried clicking on the “content inside this .txt” link and it doesn’t seem to work. I’d really like to know how you styled your widgets so I can work around that for my site. Any help very much appreciated…

  17. MindLeaks says:

    My problem is that the text widget will inherit the formatting of the themes css. How can I prevent that?

  18. Isabelle says:

    Keep it up and in a new year .

  19. Alex says:

    Hello and thank you very much

  20. WordPress Video Tutorials-39 Step by Step Videos http://www.filesonic.com/file/199042372

  21. oh its workig thanks for the share :)

  22. Jatin Soni says:

    Hello,

    Thanks for this tutorial but its still not so useful as all links are broken.. no images even no widget-content.txt film available to download.. :(

  23. hussam says:

    Hi.
    I have problem with search widget if you can take a look at my sidebar you can see how the search widget looks!

    Can you please tell me what i have to change to make it looks normally?

    Thanks
    Hussam

  24. Asad says:

    /* == WordPress CSS – Default WordPress Widgets == */

    .widget {}

    /* links widget */
    .widget_links {}
    .widget_links ul {}
    .widget_links ul li {}
    .widget_links ul li a {}

    /* meta widget */
    .widget_meta {}
    .widget_meta ul {}
    .widget_meta ul li {}
    .widget_meta ul li a {}

    /* pages widget */
    .widget_pages {}
    .widget_pages ul {}
    .widget_pages ul li {}
    .widget_pages ul li a {}

    /* recent-posts widget */
    .widget_recent_entries {}
    .widget_recent_entries ul {}
    .widget_recent_entries ul li {}
    .widget_recent_entries ul li a {}

    /* archives widget */
    .widget_archive {}
    .widget_archive ul {}
    .widget_archive ul li {}
    .widget_archive ul li a {}
    .widget_archive select {}
    .widget_archive option {}

    /* tag-cloud widget */
    .widget_links {}
    .widget_links li:after {}
    .widget_links li:before {}
    .widget_tag_cloud {}
    .widget_tag_cloud a {}
    .widget_tag_cloud a:after {}
    .widget_tag_cloud a:before {}

    /* calendar widget */
    .widget_calendar {}
    #calendar_wrap {}
    #calendar_wrap th {}
    #calendar_wrap td {}
    #wp-calendar tr td {}
    #wp-calendar caption {}
    #wp-calendar a {}
    #wp-calendar #today {}
    #wp-calendar #prev {}
    #wp-calendar #next {}
    #wp-calendar #next a {}
    #wp-calendar #prev a {}

    /* category widget */
    .widget_categories {}
    .widget_categories ul {}
    .widget_categories ul li {}
    .widget_categories ul ul.children {}
    .widget_categories a {}
    .widget_categories select{}
    .widget_categories select#cat {}
    .widget_categories select.postform {}
    .widget_categories option {}
    .widget_categories .level-0 {}
    .widget_categories .level-1 {}
    .widget_categories .level-2 {}
    .widget_categories .level-3 {}

    /* recent-comments widget */
    .recentcomments {}
    #recentcomments {}
    #recentcomments li {}
    #recentcomments li a {}
    .widget_recent_comments {}

    /* search widget */
    #searchform {}
    .widget_search {}
    .screen-reader-text {}

    /* text widget */
    .textwidget {}
    .widget_text {}
    .textwidget p {}

    and more wordpress default css is here…..
    http://digwp.com/2010/05/default-wordpress-css-styles-hooks/

Please Respond and Give your Opinion

We use Gravatar to handle our avatars. Get one there!