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 6832613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:52:47+00:00 2026-05-26T22:52:47+00:00

Is there any way to stop the conflict between same class or id of

  • 0

Is there any way to stop the conflict between same class or id of multiple css files. As I am explaining below for better understanding:

There is a master web page which has several <div> but there is a <div class"dynamic"> which always reload the contents including css files. Let’s suppose if any class of master page has the same name to reloaded elements’ class while properties are different. Then how should I handle this to stop the conflict.

master.html

<html> 
    <head> //attached master.css file here </head>
    <body> 
        <div class="myClass"> </div>
        <div class="dynamic"> /* often reload elements by ajax */ </div> 
    </body>
</html>

master.css

.myClass { height: 100px; width: 150px; background : red;}
.dynamic { height: 200p; width: 200px; }

now i am showing the reloaded html elements & css files into dynamic div of master page

reloaded tag line by ajax : <div class"myClass"> </div>

reload.css

.myClass{height: 30px; width: 25px; background: yellow; }

Now as you can see there are two classes with same name but different properties. Then how should I stop the confliction?

@Edit Thanks everyone for your support & time but my problem is different here.
the dynamic reloaded contents & css files are streaming from the client/user machine while master html page & it's css streaing directly from server.
so whatever the contents loads in dynamic div, it’s coming from client side (e.g. tag lines & css, js). in that case i am not able to handle the css file which is just reloaded by ajax() so i think it can be sort out using js/jQuery fn().

  • 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-26T22:52:48+00:00Added an answer on May 26, 2026 at 10:52 pm

    You could apply the cascading rules of the CSS:

    In your case, div.myClass inside div.dynamic should override div.myClass belongs to the body.

    you adjust the reload.css rules to

    .dynamic .myClass{height: 30px; width: 25px; background: yellow; }
    

    The cascading rules which are applied when determine which rules should apply to html div could be referenced here

    Updated 11.23

    As the OP only have control over master.css, the above solution won’t work. Thus, I suggest use child selector to limit the CSS rules to only the outer div.myClass. Modify the rule in your master.css to:

    body > .myClass {...}
    

    This rule will only apply to the .myClass which is the child of body. It leaves the spaces of styling for inner .myClass div.

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

Sidebar

Related Questions

Is there any way to stop the user resizing the form? Currently I am
Is there any way to stop the callout from automatically appearing on an embedded
Is there any way to stop IB in XCode 4 from zooming to try
Is there any way to stop polling server in SignalR? I want to stop
and I would like to know if there is any way to stop a
Is there any way to stop OpenCL kernel from execution? For example, I launch
Is there any way to stop the garbage collector for some time?
Is there any way to stop PowerShell from removing console message colors when using
Is there any way to stop the execution of a matlab program from the
Is there any way to stop a running loop inside another method or insert

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.