Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5975523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:05:49+00:00 2026-05-22T21:05:49+00:00

I am trying to write a jQuery plugin that can be ported to any

  • 0

I am trying to write a jQuery plugin that can be ported to any site.

What my plugin does is create a div and applies a style to it.

It works well in standalone but when I put it into the context of a site, there is a css class that it is inheriting from. The thing is, I can’t modify the web site’s existing CSS… so I need a way to “prevent inheritance” (which I know is technically not possible).

I have tried the !important flag on the specific styles that are causing problems, but to no avail. I am looking for a point in the right direction more than specific code, so that’s why I’m not posting all of my code…

The other thing is that I do not want to use an iframe instead of a div because I need to be able to provide the ability for a form to interact with my div, potentially.

However, the two css classes from the web site (which I can not modify) that are causing my problems are:

* {
    font-weight: inherit;
    font-style: inherit;
    border: 0 none;
    outline: 0;
    padding: 0;
    margin: 0;
}

html {
    width: 100%;
    height: 100%;
    font-size: 10px;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:05:50+00:00Added an answer on May 22, 2026 at 9:05 pm

    CSS isn’t inheritance-based, but rather “cascading” (it’s the first C in “CSS”). Understanding that, there are a few ways you could work around the issue you describe:

    1) Add inline styles to your element via script. Inline styles take precedence over CSS rules, either from classes, ids, or elements.

    2) Add your own CSS file programmatically. CSS cascades in the order the rule appears in the document. You can write a CSS link element to the bottom of the page to include your plugin’s CSS rules. Since these are presumably lower or “later” in the document than the site’s CSS, your rules will take precedence.

    3) Write a style tag to the bottom of the document programmatically. Same concept here as #2, but without an external file.

    I would personally tend toward #1. If you want your plugin to be consistent in appearance no matter what else is going on, no matter what site it is used on, the only way to be sure is to apply your styles inline.

    That said, there’s value in making your plugin’s interface customizable by using CSS classes. Maybe you’re trying to take something away that you shouldn’t. For instance, if the entire site uses a Serif font, and you’re forcing a Sans font on your plugin’s UI, your plugin’s look and feel is now at odds with the site. That could be a deal-breaker when someone is considering your plugin… customization is a good thing in the world of reusable code, and CSS is the way to make it happen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a jQuery plugin, that can be applied to a
i'm trying to write a jquery plugin that when i click on a image
For a JQuery plugin that I am trying to write I would like to
I am trying to write a plugin, following the guidelines from jQuery site. I
I'm trying to write a jQuery plugin that will provide additional functions/methods to the
I am trying to write a jQuery plugin that will have similar functionality to
Trying to figure out how to write a jquery formula that will sum all
I'm trying to write a short Wordpress JQuery for Wordpress comments that would allow
I was unsuccessful in finding a jQuery plugin that allowed me to write in
I'm trying to write a new jQuery plugin. base (this is not my plugin,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.