4 replies [Last post]
blahblahblah
Offline
newbie
Last seen: 2 years 23 weeks ago
Timezone: GMT-5
Joined: 2012-02-17
Posts: 2
Points: 3

I'm using a plugin in wordpress that is generating this code, there are two buttons on this page with the same exact IDs but I need to stylize only one of them.

Is there a way to target CSS to the second input button and not the first?

I tried to target it with stuff like this with no success.
#s2member-pro-paypal-checkout-submit input[type="submit"] {

<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" id="s2member-pro-paypal-checkout-submit" 

<input type="submit" id="s2member-pro-paypal-checkout-submit"

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 18 hours 59 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9149
Points: 3133

For any given id token, there

For any given id token, there may be only one element on a page. The coder blew it.

You may address a different attribute, though. For example:

input[type=image] {
    border: 1px solid blue;
    }
 
input[type=submit] {
    border: 1px dotted red;
    }

See §5.8 Attribute selectors.

cheers,

gary

Unplanned code results in a tangled wad of brain-cramping confusion.

There are enough html & css demos and tutorials to be interesting. Please visit.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 29 weeks 1 hour ago
London
Joined: 2004-06-06
Posts: 15650
Points: 2788

Duplicate ID's are a very

Duplicate ID's are a very common issue with WP and plugins. Shame on S2member as that is one of the more professional big plugins.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

blahblahblah
Offline
newbie
Last seen: 2 years 23 weeks ago
Timezone: GMT-5
Joined: 2012-02-17
Posts: 2
Points: 3

thanks

sure but is there a way to tie this

input[type=submit] {
    border: 1px dotted red;
    }

to specifically this input id and not apply to all inputs of type submit?

#s2member-pro-paypal-checkout-submit

I'm not sure if that's possible or what the correct syntax is.

Thanks for your help

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 18 hours 59 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9149
Points: 3133

We're going to need to see

We're going to need to see the page, in order to suggest some unique combination of selectors.

As a guess: Since you have a form, put a unique id on the form, then the selector could be #formtoken input[type=submit] {}.

cheers,

gary

Unplanned code results in a tangled wad of brain-cramping confusion.

There are enough html & css demos and tutorials to be interesting. Please visit.