CSS selector by tabindex [duplicate] - css

This question already has an answer here:
CSS data attribute conditional value selector?
(1 answer)
Closed 6 years ago.
I want to write this in CSS li[tabindex > '5'] {} to select all tabindex which have a number greater than 5. Is it possible ?

This can´t be made with CSS.
I am no expert with javascript so I can´t provide you the code, but I´m sure you can achieve it with js.
maybe this gives you a good start:
jQuery: Selecting all elements where attribute is greater than a value

Related

Pure CSS styling of <select> element but only when non-default option is selected [duplicate]

This question already has answers here:
Is there a CSS parent selector?
(33 answers)
Closed 3 years ago.
Is it possible to conditionally style the following <select> element
<select>
<option>one</option>
<option selected>default</option>
<option>two</option>
</select>
whenever the non-default options are selected, using pure CSS (no javascript)?
If there is a way, I would expect it to use some combination of pseudo-classes, something along the lines of
select:some-pseudo-class { border: 1px; }
but probably more complicated. I already looked through the list of pseudo-classes and it seems this isn't possible, but I want to confirm this with the wisdom of the crowds before giving up completely. I have also done some research on this site and came across this question from 2013 which is asking a more general question, where the (possibly outdated) answer is "no". I don't believe my question is an exact duplicate of this question, because I am asking if a special case is possible and I am looking for an answer that is up-to-date as of February 2020.
You can try with the pseudo-class option:checked {border: 1px;}

Parent element selector using pure CSS [duplicate]

This question already has answers here:
Is there a CSS parent selector?
(33 answers)
Closed 7 years ago.
What is the way of getting parent element using pure CSS. Am using VS 2013, So it must be css3. I have seen in google about has() and < selectors. Unfortunately they do not work.
There is parent selector in css4 $E > F (last in table) where $E is parent of F. Unfortunately there is no support for it (only 26% for whole css4).

html email css selector why use them [duplicate]

This question already has answers here:
Anyone know what the purpose of tagging a class with *[class]
(2 answers)
Closed 7 years ago.
I see a lot of html emails and they have CSS like this:
*[class].w320
Now I think I understand CSS selectors, but to me the above does not really make sense because you are not really targeting anything. Isn't the above the same as simply doing this?
.w320
Any thoughts why they use the selector?
Actually using square brackets (attribute selectors) is a fix for yahoo mail.
I know you understand the selectors, but just a description of what they do:
This selects all elements with a class attribute and that also are members of the w320 class
*[class].w320
And this simply selects all elements with class of .w320
.w320
You can see Email Clients' CSS Support Here

Meaning of '*' before any CSS attribute [duplicate]

This question already has answers here:
What does a star-preceded property mean in CSS?
(4 answers)
Closed 9 years ago.
what is meaning of '*' before any CSS attribute like.
.hello
{
margin-top:5px;
*margin-top:10px;
}
Thanks
Vishal
I'll answer this because it has a quick answer. Basically it's a hack to define IE only styles. IE will ignore the syntax error and apply the CSS rule anyway. However I don't recommend it. Instead use conditional comments because its safer

remove 'disabled' attr with pure css [duplicate]

This question already has answers here:
How do I disable form fields using CSS?
(13 answers)
Closed 9 years ago.
I m know how to remove disabled with js, but is it possible to user only css?
I have 2 css classes. 1 for active buttons and 1 for disabled ones! If css can enable button. I could use just jquery's addClass and removeClass...
p.s. sorry for my super english skill.
It is not possible to remove any attribute with CSS. CSS cannot change the document tree at all. It can only specify suggestions on the rendering of a document.

Resources