开发者

Is it possible to style up an <input type="submit"> in a form with no classes or ids?

I'm trying to style up a form within the Wishlist Member plugin in Wordpress and there isn't a template where I can physically go into and add classes, id's, etc. So I was wondering if there was a way to style up an <input type="submit"> with no class or id without affecting the <input type="text"> fields using javascript maybe开发者_如何学Go. Thanks.


You can add style with CSS even if there is no class/id. The following selects all input elements with attribute type="submit":

input[type="submit"]{
   /* style */
}

The above is very generic, it's better to be more exclusiver. So include some of its parents , preferable those with an ID/class:

div#someID form input[type="submit"]{
   /* style */
}

(assuming a parent <div id="someID">)


This should do the trick

input[type=submit] {
    yourCss
}


I only have 13 points, so I am unable to leave comments, which is where this belongs. But, it is important to note that:

input[type="submit"]{
/* style */
}

needs to have it's background:somestyle; stylized in order for it to work (except IE6, of course).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜