Chrome user agent stylesheet overwriting my site style

disable user agent stylesheet on my website
user agent stylesheet overrides my css
styled components user agent stylesheet
user agent stylesheet injecting styles
firefox user agent stylesheet
safari user agent stylesheet locked
user agent stylesheet webkit
margin-block-end user agent stylesheet

I have the following CSS that styles the link on one of my pages:

a:link, a:visited, a:active {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

However, when I load it, they appear blue in Chrome and white in Firefox. The Chrome dev tools reveal that my style supposedly overwrites the user agent stylesheet:

Why is it not showing correctly? I tried setting the charset at the top of my stylesheet:

@charset "UTF-8";

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    font: 11px "Lucida Grande", Arial, Sans-serif;
}

a:link, a:visited, a:active {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

input[type=email], input[type=password] {
    display: block;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border: 1px solid #ACE;
    font-size: 13px;
    margin: 0 0 5px;
    padding: 5px;
    width: 203px;
}

But it didn't help. My stylesheet is linked in the head with:

<link href="/assets/global.css?body=1" media="screen" rel="stylesheet"
type="text/css">

And the html code for the links:

<a href="/users/sign_in">Sign in</a>
<a href="/users/password/new">Forgot your password?</a>
<a href="/users/auth/facebook">Sign in with Facebook</a>

This is what they look like in Chrome (13.0.782) - incorrect:

This is what they look like in Firefox - correct:

It looks like the user agent stylesheet is overwriting my style. Why?


I don't know why but I add this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> before <html> and it solved

Modify Chrome user agent stylesheet, By using our site, you acknowledge that you have read and understand our Cookie I am not looking for how to override them with CSS. In Google Chrome, go to URL about:version and take note of the "profile path". Inside your profile folder, open the User StyleSheets folder. Just add your styles in Custom.css . Home » Html » Chrome user agent stylesheet overwriting my site style. Chrome user agent stylesheet overwriting my site style . Posted by: admin December 7, 2017 Leave a comment. Questions: I have the following CSS that styles the link on one of my page


Vonkly helped identify the issue. I went digging through all my stylesheets and I found a typo, sort of, in one of them - it was missing the parent element when defining the link style for the header, so instead of

header a:link, header a:visited {
...
}

I had

header a:link, a:visited {
...
}

so it was overriding the style I defined for the links in the body. I must have missed it while reviewing my stylesheets the first time around.

Thanks for your comments, everybody!

user agent stylesheet override my own styles, EDIT*** In what instances can user agent styles override custom CSS? in the fact that chrome is applying a style to your webpage which is overriding the style​  A couple of days ago I started to see one site that was not loading any of my styles or images when using Chrome. It works fine in Firefox. Both browsers are current. When I look at Dev Tools in Chrome and look at a style sheet entry, it shows link { display: none;} whereas in Firefox it shows:


Just add <!DOCTYPE html> before the <html> tag.

How to stop user agent stylesheets from overriding my css, In chrome, I see that the "user agent stylesheet" is overriding my css. Wtf? <!​doctype html> <body> <div class='a'> <input type='checkbox'> </div> <style> .a  For example, in the screenshot below the selected element inherits display:list-item from user agent stylesheet. The labels on the image below correspond with the numbered items below it. Styles associated with a selector that matches the element. User agent stylesheets are clearly labelled, and are often overridden by the CSS on your web page.


I was having same kind of problem, i my case my some classes are forcefully settled to display : none

After 30/40 min i looked up on browser extensions , and found out all these was happening due to AD Blocker.

so if any above solution does'nt work for you, then try this as well once if you have this kind of browser extension.

Find Overriding CSS Declarations In Chrome DevTools, If you can see your new CSS in the Styles pane, but your new CSS is including user-agent stylesheets, enable the Show All checkbox. Chrome user agent stylesheet overwriting my site style (4) I have the following CSS that styles the link on one of my pages: a:link, a:visited, a:active { color: white; text-decoration: none; font-weight: bold; }


The user agent stylesheet only kicks in if your css neglects to define a property for a tag. Consider that you might have a typo in your css style.

Chances are that, if you put the tag declaration at the beginning of the css file and it works, that you have an error in your css.

Try running your css thru CSS Lint

I had this persistent problem and discovered a mistake in my css.

Override The User Agent String From Chrome DevTools, Select a user agent string from the list, or enter your own custom string. Feedback​. Was this page helpful? Yes. Recommend:css - Chrome get "user agent stylesheet" posibility to get this "user agent stylesheet" to see what are the default chrome css settings I know that I need to override it or use reset style, but I just want to get this chrome built-in css css google-chrome share | improve this qu


Can't seem to override user agent styles, I'm working on a nav. I have my ul element styled with margin: 0 and padding: 0 but I still see padding. It looks like it's coming from the Chrome user agent stylesheet. Perhaps a link to the actual site? Author. Posts. Viewing 4  In Chrome developer tools, it says user agent stylesheet in place of the CSS file name. Now if I submit a form and some validation error occurs, I get the following stylesheet: The font-size from these new styles is disturbing my design. Is there a way to force my stylesheets and if possible, completely overwrite Chrome's default stylesheet?


revert, If used by a site's own styles (the author origin), revert rolls back the property's If used within the user agent's default styles, this keyword is It is still possible to override revert value using specificity. revert, Chrome No support No Get the latest and greatest from MDN delivered straight to your inbox. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more . How to turn off user agent stylesheet in chrome. Ask Question Asked 6 years, 5 months ago. Active 1 year, 5 months ago. Viewed 5k ti


override user agent stylesheet, Is there a way to override user agent stylesheet ? Should you not be able to do that by adding !important to your style declarations? I have my ul element styled with margin: 0 and padding: 0 but I still see padding. It looks like it’s coming from the Chrome user agent stylesheet. It looks like it’s coming from the Chrome user agent stylesheet.