Mobile app version of vmapp.org
Login or Join
Welton168

: CSS: Is there any way to select an item to be hidden besides tag, class, or ID? Here's my situation: I have a web-based app (Jira) that I'm using that I'd like to modify slightly by using

@Welton168

Posted in: #Css #Html

Here's my situation: I have a web-based app (Jira) that I'm using that I'd like to modify slightly by using my own code via the Stylish Chrome extension. In one column of the app, there are symbols showing "low priority" and "high priority" arrows. I want to hide all of the low priority symbols.

Normally it'd be easy. I'd just use something like this:

.prioritysymbol.low img {display: none}


However, the code isn't marked up to allow me to target specific images like that.

Are there any other ways for me to target those images? It'd be nice if I could target by SRC, ALT, or TITLE, since those are all different based on the version of the image.

Thanks!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Welton168

1 Comments

Sorted by latest first Latest Oldest Best

 

@Berryessa866

You can use attributes as selectors in CSS.

[attr] Selects an element with an attribute name of attr.

[attr=value] Selects an element with an attribute name of attr and whose value is exactly "value".

[attr~=value] Selects an element with an attribute name of attr whose value is a whitespace-separated list of words, one of which is exactly "value".

[attr|=value] Selects an element with an attribute name of attr. Its value can be exactly “value” or can begin with “value” immediately followed by “-” (U+002D). It can be used for language subcode matches.

[attr^=value] Selects an element with an attribute name of attr and whose value is prefixed by "value".

[attr$=value] Selects an element with an attribute name of attr and whose value is suffixed by "value".

[attr*=value] Represents an element with an attribute name of attr and whose value contains at least one occurrence of string "value" as substring.



This, for example, will target all internal links (href attribute beginning with #):

a[href^="#"] { background-color: #000 ; }




You can read more about attribute selectors here:


CSS-Tricks - Attribute Selectors
CSS 2.1 Specification - Attribute Selectors
CSS Selectors Level 3

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme