Paul Albert
Paul Albert

Reputation: 163

How do I use CSS to select for a tag with arbitrary name attribute?

This will allow me to select for the "a" tag with name of educationalTraining:

a[name=educationalTraining] {
    color: rgb(89, 91, 91);
}

How would I get all "a" tags with any name. This doesn't seem to work:

a[name=*] {
    color: rgb(89, 91, 91);
}

Unfortunately, I can't just select for any "a" tags. It's only ones that use the name attribute that I am interested in.

Upvotes: 2

Views: 207

Answers (2)

keeg
keeg

Reputation: 3978

try:

a[name] {
    color: rgb(89, 91, 91);
}

Upvotes: 3

Duver
Duver

Reputation: 500

Try:

a[name] {
    color: rgb(89, 91, 91);
}

Demo: http://jsfiddle.net/gQL9J/

Upvotes: 10

Related Questions