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

  • Home
  • SEARCH
  • 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 7529677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:43:24+00:00 2026-05-30T04:43:24+00:00

As an example I got a css class which applies to all labels within

  • 0

As an example I got a css class which applies to all labels within my website.

label
{
 font-size: 18px;
}

Now after i install a external JS plugin i find that the plugin itself is affected by my base css.

<div>
    <div class="plugin" />
    <label>Xyz</label> 
    //Dynamic html inserted by plugin
</div>

The plugin has its own stylesheet so how can i prevent my base css style touching any elements within the plugin div?

EDIT

I must add that label was a very simple example. The actual layout is more complex with global styles touching various elements.

  • 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-30T04:43:25+00:00Added an answer on May 30, 2026 at 4:43 am

    Don’t make your css too general, try to be as specific as possible when you want to style only some of your elements. If you can’t select your elements without affecting the plugin’s elements add a class to them.

    label{ /* too general, don't use this */
     /* ... */
    }
    body > div > form > label{ /* more specific, but maybe still affecting your plugin */
     /* ... */
    }
    
    label.noplugin{ /* use a class on non-plugin elements */
     /* ... */
    }
    
    div:not(.plugin) > label{ /* affecting only children of div which are NOT
        tagged with the plugin class */
     /* ... */
    }
    

    So in your case a better way to style your label would be

    <div>
        <div class="plugin">
        <label>Xyz</label>
        //Dynamic html inserted by plugin
        </div>
    </div>
    

    CSS:

    *:not(.plugin) > label
    {
     font-size: 18px;
    }
    

    Please note that :not is unfortunately not supported by IE ≤8.

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

Sidebar

Related Questions

i've got a very simple CSS example detailed below. The .entry class generates a
For example i got a class and its got its own properties and i
Suppose I've got the following program: namespace ReflectionTest { public class Example { private
I've got an internationalised web application in which all the text that eventually gets
Creating a website using simple html(not html5) and css but got stock in mouseover
I got the example in this link . I can't understand the addmove ,
i've got following example xml: <entity id=1> <name>computer</name> <type>category</type> <entities> <entity id=2> <name>mac</name> <type>category</type>
thank you for looking i got this example from my book but i cant
(dd/MM/yyyy HH)+ - + (x.Hour+1).ToString(); So here is example what I got and what
I've got a domain example.com and an alternative of some-example.com . I'm trying to

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.