Can I apply a CSS style to an element name?

I’m currently working on a project where I have no control over the HTML that I am applying CSS styles to. And the HTML is not very well labelled, in the sense that there are not enough id and class declarations to differentiate between elements.

So, I’m looking for ways I can apply styles to objects that don’t have an id or class attribute.

Sometimes, form items have a “name” or “value” attribute:

<input type="submit" value="Go" name="goButton">

Is there a way I can apply a style based on name=”goButton”? What about “value”?

It’s the kind of thing that’s hard to find out because a Google search will find all sorts of instances in which broad terms like “name” and “value” will appear in web pages.

I’m kind of suspecting the answer is no… but perhaps someone has a clever hack?

Any advice would be greatly appreciated.

10 Answers
10

Leave a Comment