When loading my site on the client web page there are problems with conflict in css

When I upload my site to the client URL, an error occurs that takes the css property from the css client and changes in our css, which affects my site.

Is there a way to write all the property and value in my class so that it does not accept css from the client?

+4
source share
2 answers

In cases where both style sheets have the same properties, but the wrong style sheet wins (for example, you have p {border: 1px solid green; color: blue}, but client css has p {border: 1px solid red}, and the tables get a red border):


, , (, borderless div s, css p {border: 1px solid red}), : p {border: 0;}.

, -

/* client styles */
p {
  border: 1px solid blue
}
/* your styles */
.reset p {
  border: 0;
}
<p>client (border)</p>
<div class="reset">
  <p>you (no border)</p>
</div>
Hide result

, , , , , .main. .main p.

, reset . , :

/* client styles */
p {
  border: 1px solid blue
}
/* your styles */
p.reset {
  border: 0;
}
<p>client (border)</p>
<p class="reset">you (no border)</p>
Hide result

, , "reset.css" reset.

0

css? DOM -css cc-. , css ​​ link-css-.

extract-text-plugin - css, DOM css .

0

Source: https://habr.com/ru/post/1653642/


All Articles