Home > Net >  Chrome adds element style color: rgb(17, 17, 17);
Chrome adds element style color: rgb(17, 17, 17);

Time:12-20

When rendering a web page, Chrome adds style="color: rgb(17, 17, 17);" to all

tags of my web page. These are all declarartions of any P tag: `

element.style {
    color: rgb(17, 17, 17);
}
@media only screen and (min-width: 814px)
main p {
    margin-top: 0;
}
@media only screen and (min-width: 814px)
dt, main dd, main h1, main h2, main h3, main h4, main h5, main h6, main p {
    max-width: 776px;
    margin-left: auto;
    margin-right: auto;
}
@media only screen and (min-width: 361px)
article p {
    text-indent: 1em;
    margin-top: 0.3rem;
}
@media only screen and (min-width: 361px)
#poprzednie p, header, main p {
    text-align: justify;
}
main header, main li, main p, poprzednie li, poprzednie p {
    hyphens: auto;
}
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border: 0;
}
user agent stylesheet
p {
    display: block;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
}
#page {
    font: 1.8rem/170% Arimo,sans-serif;
    color: #332;
}
#page, footer {
    margin: 0 auto;
    max-width: 986px;
    border: 3px double grey;
    text-align: left;
}
:root {
    --season: royalblue;
    --season: #4a1;
    --season: #cf3804;
    --season: #900;
    --season: #68e;
    --season: #9f6804;
    font-size: 10px;
}

` Please nb. the color of all tags has been declared below to #332. Firefox renders page with correct color, but not Chrome or Chromium browsers.

CodePudding user response:

It looks like the color of your p tags is being set to rgb(17, 17, 17) by the element.style rule in your CSS. This rule is being applied by the browser and is not present in your original CSS.

To fix this issue, you can try the following approaches:

Check if there is any JavaScript code on your page that is setting the style of the p tags. If you find any code that is setting the color of the p tags, you can modify or remove it to fix the issue.

You can override the element.style rule by adding a more specific rule for the p tags in your CSS. For example:

p {
  color: #332 !important;
}

This will force the color of the p tags to be #332, regardless of any other rules that might be applied to them.

You can try clearing your browser's cache and reloading the page to see if that fixes the issue. Sometimes, the browser can apply incorrect styles if the page is not loading properly. I hope this helps! Let me know if you have any other questions.

CodePudding user response:

From "How do I find the origin source of an element.style? i.e. Which JS or jQ file is injecting it. I want to fix, not override,

Robotnicka's answer may help you :

[...] In Chrome, if you right click on an element and "inspect," then view the styles in the "Computed" tab then you should see what styles are affecting the element. [...]

  • Related