Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS - reCAPTCHA image width

I need to specify two different widths for "#recaptcha_image" As the recatcha image is placed in #recaptcha_image div, I had added custom width in my CSS, as following:

#recaptcha_image img {width: 200px !important; height: 38px !important; }

As I can not change the DIV id, how can i specify the second width for #recaptcha_image in the same CSS file? I can use only ONE CSS file because i have a common header, which includes CSS file.

Thanks.

like image 446
Roman Avatar asked Nov 19 '25 23:11

Roman


1 Answers

You could create a class in the CSS with a different width:

#recaptcha_image img.newWidth {width: 100px }

You would then have to add that class to the element at the required time.

I know you didn't mention JavaScript in the question, but you could also use JavaScript to change the width when necessary by using element.style.width = '100px';

like image 104
James Allardice Avatar answered Nov 21 '25 15:11

James Allardice



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!