Can I apply a CSS style to an element name?

You can use the attribute selector,

input[name="goButton"] {
  background: red;
}
<input name="goButton">

 Run code snippetExpand snippet

Be aware that it isn’t supported in IE6.

Update: In 2016 you can pretty much use them as you want, since IE6 is dead. http://quirksmode.org/css/selectors/

http://reference.sitepoint.com/css/attributeselector

Leave a Comment