css in my JavaScript widget colliding with target page css

后端 未结 3 845
忘掉有多难
忘掉有多难 2020-12-22 07:16

I\'ve written a pretty basic widget for voting, users install it pretty much like the Google analytics code by simply adding a JavaScript code to the bottom of their code.

相关标签:
3条回答
  • 2020-12-22 07:35

    Use Iframe or use inline CSS for your elements.

    0 讨论(0)
  • 2020-12-22 07:38

    Put your widget in an iframe, then it won't be affected by anything on the target page.

    0 讨论(0)
  • 2020-12-22 07:43

    Use !important for the css of your widget.

    Example:

    .widget {
        font: 16px Arial !important;
    }
    
    0 讨论(0)
提交回复
热议问题