WordPress.org

Ready to get started?Download WordPress

Forums

Widget CSS Classes
[resolved] CSS to affect content created by other plugins? (5 posts)

  1. solid7
    Member
    Posted 8 months ago #

    I have made a widget that displays a table, which I made using Tablepress. I would like to resize the table so that it all fits in the sidebar. However, even after I define a class for the widget, I can't seem to figure out how to affect the sizing. Is there a way to make this work? The table has its own custom CSS, and I am trying to add custom CSS to this widget. (I have the "posts in sidebar" plugin)

    http://wordpress.org/plugins/widget-css-classes/

  2. Cindy
    Member
    Plugin Author

    Posted 8 months ago #

    It will depend on the CSS the plugin is using, but you can try adding !important to the CSS. For example:

    .mycustomclass {
       color: #000 !important;
    }
  3. solid7
    Member
    Posted 8 months ago #

    Tablepress uses its own custom CSS.

    Your example is very nice, but it only seems to affect things relative to the sidebar, only - not the actual content.

    Here is my breakdown, if it helps at all:

    Tablepress to make a table. (including CSS)
    Post to include the table with shortcode
    Posts in Sidebar to include the post which contains the Tablepress

    In case you might be curious why I'm doing this, it is a table for sports scores, and the upcoming game to be played. Perhaps there is a better way to accomplish what I'm doing? I don't know how to do this any other way without duplicating the table, which I'm going to say, is a no go.

    Thank you for your reply.

  4. Cindy
    Member
    Plugin Author

    Posted 7 months ago #

    It's hard to say why it's not working. It could be something relating to TablePress's CSS that you need more exact CSS to override. I don't know TablePress's CSS but if they're doing something like:

    .tablepress td { font-size: 1em; }

    You'd need to do .mycustomclass .tablepress td { font-size: 0.8em; }

  5. solid7
    Member
    Posted 7 months ago #

    Thanks, Cindy... That's exactly what I needed.

    Very much appreciated.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.