css-specificity Questions
4
Solved
I have this small HTML:
<div id="column">
<div class="ticker">
<ul>
<li>Item 1</li>
</ul>
</div>
</div>
For ul elements outside of the .ticke...
Newfangled asked 22/5, 2014 at 18:31
8
Solved
If you have
<div style="display: none !important;"></div>
Is there a way to override that in the style sheet to make it displayed?
Preferably using something similar to this:
div {...
Etz asked 22/6, 2012 at 5:36
4
If I want to increase the CSS specificity of a rule, I tend to prefix with html, but I wonder if there are more concise ways of doing this?
(It may seem like a trivial issue, but over the course o...
Machinate asked 16/10, 2013 at 9:23
5
Solved
I have a element like this:
#idname{
border: 2px solid black;
}
.classname{
border: 2px solid gray;
}
<div id = "idname" class="classname">it is a test</div>
I wan...
Kempe asked 26/2, 2016 at 16:53
2
I have a CSS template where I want to use a minimal amount of attributes within some HTML markup, while allowing for easy customization of that markup via classes (not IDs) later, if needed.
<u...
Roughandready asked 21/9, 2019 at 7:7
8
Solved
The title basically says it all.
Suppose I have an element which I want to change color on :hover, but while clicked, I want it to switch back to its original color. So, I've tried this:
a:link, ...
Priest asked 22/9, 2011 at 0:10
7
Solved
I want to change ☰ color.
HTML:
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#menu">
<span class="sr-only">Toggle menu navigation</span>
<...
Boschbok asked 12/12, 2013 at 10:12
3
Solved
Does anyone know if there is some kind of tool to see/pick the best CSS selector based on CSS specificity to target a particular div?
I know what has higher specificity, but sometimes when working...
Aeriform asked 25/12, 2011 at 18:7
3
Solved
I'm wondering what the specificity of the attribute selector is. For example:
Id = 100 points
Class = 10 points
Html Tag= 1 point
Example:
/* this specificity value is 100 + 10 + 1 = 111 */
#h...
Foretop asked 10/7, 2012 at 5:9
1
Solved
I'm studying a bit of CSS and from reading there are some pseudo-classes that don't have specificity like where() and not(). Are there more?
Mcallister asked 16/12, 2019 at 18:33
9
Solved
I've been working on a website for a few months, and a lot of times when I've been trying to edit something, I have to use !important, for example:
div.myDiv {
width: 400px !important;
}
...
Schematic asked 14/9, 2010 at 7:23
2
Solved
I'm trying to figure out why .x has higher specificity than *.x when the latter is expected to win.
Isn't *.x supposed to have a specificty of 0-0-1-1 (1 class, 1 tag) while .x is just a single cl...
Masseuse asked 15/4, 2016 at 9:41
4
Solved
What is the level of CSS specificity received by inherited properties? I read through the W3 recommendation regarding CSS specificity and so I understand how to calculate the different specificitie...
Syrup asked 9/2, 2015 at 21:55
4
Solved
Let's take these three selectors, sorted from the highest specificity to the lowest:
.special-section p { }
.weird-font { }
p { }
Many CSS gurus recommend against nesting like in the first selec...
Cedar asked 23/12, 2015 at 11:6
2
Solved
What do I need to do to give the [id^=value] selector the same specificity as a regular ID, and why isn't it equal or greater already? (considering that I gave it html as well)
html div[id^="blue"...
Stonefish asked 30/9, 2015 at 13:57
2
Solved
#box {
width: 100px;
height: 100px;
background-color: #ff0;
}
.one.two.three.four.five.six.seven.eight.nine.ten.eleven {
background-color: #f00;
}
<div id="box" class="one two three...
Wang asked 9/4, 2018 at 21:28
4
Solved
There are a bunch of same-level CSS styles and an HTML code with nested blocks to which the styles are applied:
.style1 a {
color: red;
}
.style2 a {
color: green;
}
<div class="sty...
Tanta asked 23/11, 2015 at 9:26
3
Solved
So I have a list of items inside a div with the class book-select and one of the li's in my unordered list has the class selected. According to the CSS rules I've defined, the li's in the div has t...
Daffie asked 9/6, 2017 at 15:16
1
Solved
Is it possible to set the specificity of a CSS selector, as opposed to it only being determined by counts of the selector(s) comprising it? i.e., if I have two selectors like so (showing the calcul...
Overshoot asked 27/5, 2017 at 16:14
1
Solved
Do I need to add !important to all properties in the media queries I've written for my site like in the example below?
I had the CSS below at the bottom of my stylesheet, but I found that th...
Rattish asked 11/4, 2017 at 14:9
2
Solved
For example to style standard inputs I write something like:
input:not([type="checkbox"]):not([type="radio"]) {
background-color: blue;
}
However that increases the specificity a lot so if I wa...
Statics asked 8/3, 2017 at 20:29
7
Solved
Researching specificity I stumbled upon this blog - http://www.htmldog.com/guides/cssadvanced/specificity/
It states that specificity is a point-scoring system for CSS. It tells us that elements ...
Isabellisabella asked 11/5, 2010 at 8:17
7
Solved
I am creating a contact form that will be included on several different sites.
The styles of the contact form and the styles of the site will both be included and I can't very well predict ...
Corrales asked 15/12, 2010 at 17:37
2
Solved
I have read on css tricks that :not should not add additional specificity. But it looks like it does?
https://css-tricks.com/almanac/selectors/n/not/
The specificity of the :not pseudo class is...
Forgat asked 27/1, 2016 at 13:21
4
Solved
When viewing the code below in my browser the background is white. The universal selector * has the lowest specificity, and the body selector comes after the universal selector. Shouldn't it ...
Baalbeer asked 9/1, 2016 at 20:0
1 Next >
© 2022 - 2024 — McMap. All rights reserved.