4 replies [Last post]
blahblahblah
Offline
newbie
Last seen: 2 years 43 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: 50 min 16 sec ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9276
Points: 3282

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

UI design should be egoless; if you succumb to the temptation to show off, you’re probably doing it wrong. (from ESR)

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

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 1 week 1 day ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

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 43 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: 50 min 16 sec ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9276
Points: 3282

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

UI design should be egoless; if you succumb to the temptation to show off, you’re probably doing it wrong. (from ESR)

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