chrome : how to turn off user agent stylesheet settings?
https://developers.google.com/chrome-developer-tools/docs/settings
- Open Chrome dev tools
- Click gear icon on bottom right
- In General section, check or uncheck "Show user agent styles".
Chrome : user agent stylesheet turn off for transparent background
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus
input:-webkit-autofill,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
-webkit-text-fill-color: #fff !important;
-webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0) inset !important;
transition: background-color 5000s ease-in-out 0s !important;
}
Try this
Update
if the code above doesn't work for you for some reason, here is another one:
@-webkit-keyframes autofill {
to {
color: #fff;
background: transparent;
}
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
-webkit-animation-name: autofill;
-webkit-animation-fill-mode: both;
}
How to stop user agent stylesheets from overriding my css
The "problem" here is that there is actually no input
style in the author stylesheet (see the spec for more info), and therefore the style that is defined in the user agent stylesheet is used.
The (relevant) user agent rule (on chrome) is:
input, input[type="password"], input[type="search"] {
cursor: auto;
}
You can achieve what you want in a couple ways:
- Create a css class that selects the input directly, for example
- using another css class, or
- selecting the input within the already-defined class,
- etc
- Explicitly setting inheritance behavior for the cursor style on all inputs
For (1):
<style>
.a, .a input {
cursor: pointer;
}
</style>
For (2):
<style>
input {
cursor: inherit;
}
.a {
cursor: pointer;
}
</style>
Override USER AGENT STYLE SHEET - Chrome
Just add the following style:
ul { padding:0 }
That will override the default style.
What is a user agent stylesheet?
What are the target browsers? Different browsers set different default CSS rules. Try including a CSS reset, such as the meyerweb CSS reset or normalize.css, to remove those defaults. Google "CSS reset vs normalize" to see the differences.
Chrome get user agent stylesheet
Take a look here:
http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css
For some other browsers: Browsers' default CSS for HTML elements
Related Topics
Is There a Reason Why CSS Doesn't Support Ids and Classes, Starting from Numbers
CSS Specificity or Inheritance
How to Target Microsoft Edge with CSS
Two CSS Files Defining Same Class
What Is Caret Symbol ^ Used for in CSS When Selecting Elements
How to Override Stylesheets of Primefaces
How Should You Prefix Transform Properties in CSS3 Animations
How to Flip Background Image Using CSS
CSS Vertical Scrollbar Padding Left/Right in Ul Possible
Pass Function or Mixin by Reference in SASS
Label on the Left Side Instead Above an Input Field
Horizontal Masonry Layout with Flexbox CSS Only
Why Doesn't Position: Sticky Work in Chrome
CSS Cursor Pointer with Svg Image