Plugin Development/ Stop CSS clashes.

I have searched all over and I am a little confused about my first plugin that I am developing.

I created a shortcode that the user can use on any page they create. The issue is that on a lot of themes the plugin gets pushed out of container width.

I think that most templates are 960px wide, and my plugin is 800px wide (I am not looking for advise on developing with em, percentages, etc. this is a fixed sized plugin).

How can I stop css clashes? I want the container width to be 960px wide. There must be some default id’s and classes that I can overwrite in my css.

I would imagine themes use standard naming conventions in order to allow users to switch at anytime.

EDIT: I would also like to remove any sidebar() that is showing on the page…help!?

Anyway, does anyone have advice on this?

thanks!

Solutions Collecting From Web of "Plugin Development/ Stop CSS clashes."

If you don’t know, and can’t control, the content width, then your Plugin shouldn’t assume any given content width.

Also, even though templates may be 960px in total width, the content width will almost assuredly be less than that.

If you must apply explicit width to your output, you could try returning the value set for the $content_width global, and then use that value in your generated CSS.

Well really you shouldn’t be looking to modify the theme layout, your’s is the addon after all and it should be up to the theme author/admin to make sure their theme works with your plugin if they want to use it.

In any case have you tried using the css !important declaration on you container?

#mycontainer{
    width:960px!important;
}

That should force your container’s width, then it’s up to whoever is using it to make sure their theme is compatible.