CSS type selector overrides attribute selector?Set cellpadding and cellspacing in CSS?Which characters are valid in CSS class names/selectors?Is there a CSS parent selector?What does the “+” (plus sign) CSS selector mean?css selector to match an element without attribute xIs there a “previous sibling” CSS selector?When to use margin vs padding in CSSChange an HTML5 input's placeholder color with CSSCSS selector for first element with classIs it possible to apply CSS to half of a character?
Can compressed videos be decoded back to their uncompresed original format?
Alternative to sending password over mail?
Personal Teleportation: From Rags to Riches
How badly should I try to prevent a user from XSSing themselves?
Is there a hemisphere-neutral way of specifying a season?
How do conventional missiles fly?
Have there been efforts to prevent length extension attacks of hashing algorithms that are based on the Merkle–Damgård construction?
Theorists sure want true answers to this!
How painful is tzara'at
Can my sorcerer use a spellbook only to collect spells and scribe scrolls, not cast?
What does the expression "A Mann!" means
In Bayesian inference, why are some terms dropped from the posterior predictive?
Mathematica command that allows it to read my intentions
Using Advanced Custom Field (ACF) to insert meta description on each page
Why were 5.25" floppy drives cheaper than 8"?
Where would I need my direct neural interface to be implanted?
Which is the best way to check return result?
Processor speed limited at 0.4 GHz
Detention in 1997
Why can't we play rap on piano?
How to tell a function to use the default argument values?
Is it a bad idea to plug the other end of ESD strap to wall ground?
How do I deal with an unproductive colleague in a small company?
Hefsek between Karpas and maror?
CSS type selector overrides attribute selector?
Set cellpadding and cellspacing in CSS?Which characters are valid in CSS class names/selectors?Is there a CSS parent selector?What does the “+” (plus sign) CSS selector mean?css selector to match an element without attribute xIs there a “previous sibling” CSS selector?When to use margin vs padding in CSSChange an HTML5 input's placeholder color with CSSCSS selector for first element with classIs it possible to apply CSS to half of a character?
Generally speaking, an attribute selector has higher specificity than a type selector, but in the image below, the type selector wins (margin
is set to 0
)?
Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?
css css-selectors css-specificity
|
show 2 more comments
Generally speaking, an attribute selector has higher specificity than a type selector, but in the image below, the type selector wins (margin
is set to 0
)?
Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?
css css-selectors css-specificity
1
instead of a screenshot share a code that reproduce this so we can better see.
– Temani Afif
Mar 8 at 21:41
1
Please include a Minimal, Complete, and Verifiable example of the relevant code in the question itself.
– TylerH
Mar 8 at 21:41
2
"Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?" Yes. The concept in the cascade that's relevant here is the origin
– Alohci
Mar 8 at 23:31
@Alohci If you could post that as an answer, the OP could accept it.
– Mr Lister
Mar 9 at 8:46
@TylerH: It's not possible to provide one given that part of the code that's required is coming internally from the UA. A Stack Snippet with just the button, input, optgroup, select, textarea CSS rule by itself is not terribly clear as an MCVE as readers would still need to do the manual work (God forbid) of opening their Chrome dev tools. Alternatively it could include the UA styles ahead of the author styles to simulate the cascading order, but that would not even be Verifiable because then you're just comparing two author-level rules.
– BoltClock♦
Mar 16 at 6:08
|
show 2 more comments
Generally speaking, an attribute selector has higher specificity than a type selector, but in the image below, the type selector wins (margin
is set to 0
)?
Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?
css css-selectors css-specificity
Generally speaking, an attribute selector has higher specificity than a type selector, but in the image below, the type selector wins (margin
is set to 0
)?
Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?
css css-selectors css-specificity
css css-selectors css-specificity
edited Mar 8 at 21:41
TylerH
16.1k105569
16.1k105569
asked Mar 8 at 21:38
Zico DengZico Deng
3318
3318
1
instead of a screenshot share a code that reproduce this so we can better see.
– Temani Afif
Mar 8 at 21:41
1
Please include a Minimal, Complete, and Verifiable example of the relevant code in the question itself.
– TylerH
Mar 8 at 21:41
2
"Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?" Yes. The concept in the cascade that's relevant here is the origin
– Alohci
Mar 8 at 23:31
@Alohci If you could post that as an answer, the OP could accept it.
– Mr Lister
Mar 9 at 8:46
@TylerH: It's not possible to provide one given that part of the code that's required is coming internally from the UA. A Stack Snippet with just the button, input, optgroup, select, textarea CSS rule by itself is not terribly clear as an MCVE as readers would still need to do the manual work (God forbid) of opening their Chrome dev tools. Alternatively it could include the UA styles ahead of the author styles to simulate the cascading order, but that would not even be Verifiable because then you're just comparing two author-level rules.
– BoltClock♦
Mar 16 at 6:08
|
show 2 more comments
1
instead of a screenshot share a code that reproduce this so we can better see.
– Temani Afif
Mar 8 at 21:41
1
Please include a Minimal, Complete, and Verifiable example of the relevant code in the question itself.
– TylerH
Mar 8 at 21:41
2
"Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?" Yes. The concept in the cascade that's relevant here is the origin
– Alohci
Mar 8 at 23:31
@Alohci If you could post that as an answer, the OP could accept it.
– Mr Lister
Mar 9 at 8:46
@TylerH: It's not possible to provide one given that part of the code that's required is coming internally from the UA. A Stack Snippet with just the button, input, optgroup, select, textarea CSS rule by itself is not terribly clear as an MCVE as readers would still need to do the manual work (God forbid) of opening their Chrome dev tools. Alternatively it could include the UA styles ahead of the author styles to simulate the cascading order, but that would not even be Verifiable because then you're just comparing two author-level rules.
– BoltClock♦
Mar 16 at 6:08
1
1
instead of a screenshot share a code that reproduce this so we can better see.
– Temani Afif
Mar 8 at 21:41
instead of a screenshot share a code that reproduce this so we can better see.
– Temani Afif
Mar 8 at 21:41
1
1
Please include a Minimal, Complete, and Verifiable example of the relevant code in the question itself.
– TylerH
Mar 8 at 21:41
Please include a Minimal, Complete, and Verifiable example of the relevant code in the question itself.
– TylerH
Mar 8 at 21:41
2
2
"Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?" Yes. The concept in the cascade that's relevant here is the origin
– Alohci
Mar 8 at 23:31
"Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?" Yes. The concept in the cascade that's relevant here is the origin
– Alohci
Mar 8 at 23:31
@Alohci If you could post that as an answer, the OP could accept it.
– Mr Lister
Mar 9 at 8:46
@Alohci If you could post that as an answer, the OP could accept it.
– Mr Lister
Mar 9 at 8:46
@TylerH: It's not possible to provide one given that part of the code that's required is coming internally from the UA. A Stack Snippet with just the button, input, optgroup, select, textarea CSS rule by itself is not terribly clear as an MCVE as readers would still need to do the manual work (God forbid) of opening their Chrome dev tools. Alternatively it could include the UA styles ahead of the author styles to simulate the cascading order, but that would not even be Verifiable because then you're just comparing two author-level rules.
– BoltClock♦
Mar 16 at 6:08
@TylerH: It's not possible to provide one given that part of the code that's required is coming internally from the UA. A Stack Snippet with just the button, input, optgroup, select, textarea CSS rule by itself is not terribly clear as an MCVE as readers would still need to do the manual work (God forbid) of opening their Chrome dev tools. Alternatively it could include the UA styles ahead of the author styles to simulate the cascading order, but that would not even be Verifiable because then you're just comparing two author-level rules.
– BoltClock♦
Mar 16 at 6:08
|
show 2 more comments
1 Answer
1
active
oldest
votes
Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?
Yes. The technical name for "custom CSS" is author-level CSS as detailed in this section of the spec. Specificity is only relevant when you're comparing two CSS rules that have the same origin, either two UA styles or two author styles.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55071360%2fcss-type-selector-overrides-attribute-selector%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?
Yes. The technical name for "custom CSS" is author-level CSS as detailed in this section of the spec. Specificity is only relevant when you're comparing two CSS rules that have the same origin, either two UA styles or two author styles.
add a comment |
Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?
Yes. The technical name for "custom CSS" is author-level CSS as detailed in this section of the spec. Specificity is only relevant when you're comparing two CSS rules that have the same origin, either two UA styles or two author styles.
add a comment |
Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?
Yes. The technical name for "custom CSS" is author-level CSS as detailed in this section of the spec. Specificity is only relevant when you're comparing two CSS rules that have the same origin, either two UA styles or two author styles.
Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?
Yes. The technical name for "custom CSS" is author-level CSS as detailed in this section of the spec. Specificity is only relevant when you're comparing two CSS rules that have the same origin, either two UA styles or two author styles.
answered Mar 16 at 6:13
BoltClock♦BoltClock
529k13011721208
529k13011721208
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55071360%2fcss-type-selector-overrides-attribute-selector%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
instead of a screenshot share a code that reproduce this so we can better see.
– Temani Afif
Mar 8 at 21:41
1
Please include a Minimal, Complete, and Verifiable example of the relevant code in the question itself.
– TylerH
Mar 8 at 21:41
2
"Is it because user agent stylesheet (browser default style) always gets overridden by custom CSS regardless of CSS specificity?" Yes. The concept in the cascade that's relevant here is the origin
– Alohci
Mar 8 at 23:31
@Alohci If you could post that as an answer, the OP could accept it.
– Mr Lister
Mar 9 at 8:46
@TylerH: It's not possible to provide one given that part of the code that's required is coming internally from the UA. A Stack Snippet with just the button, input, optgroup, select, textarea CSS rule by itself is not terribly clear as an MCVE as readers would still need to do the manual work (God forbid) of opening their Chrome dev tools. Alternatively it could include the UA styles ahead of the author styles to simulate the cascading order, but that would not even be Verifiable because then you're just comparing two author-level rules.
– BoltClock♦
Mar 16 at 6:08