简体   繁体   English

无法使用Recaptcha更改CSS类值

[英]can not change a css class value using recaptcha

I am using recaptcha for a form and am trying to change its width but not to give. 我正在为表单使用Recaptcha,并尝试更改其宽度但不给。

I have an id that has width 153px! 我有一个宽度为153px的ID! Important and I want to change to 260px but whenever I try the initial value is prevailing. 重要提示,我想更改为260px,但是每当尝试尝试时,初始值都将占上风。

I already tried these ways: 我已经尝试过这些方法:

1st - $ ('# recaptcha_area') css ({'width': '260px important! '}); 1st- $ ('# recaptcha_area') css ({'width': '260px important! '});

2nd - $ ('# recaptcha_area') addClass ('test'); 2- $ ('# recaptcha_area') addClass ('test');

thank you all 谢谢你们

This won't change as if the minimum width of recaptcha is 300px set by google. 这不会改变,好像recaptcha的最小宽度是Google设置的300px。 But if you want to try you do like this: 但是,如果您想尝试,可以这样做:

$('#recaptcha_area').css('width','260px','important');

I was also facing this problem later I used zoom to decrease it's width. 后来我也使用zoom宽度来解决这个问题。 So you can use css like this: 因此,您可以像这样使用CSS:

#recaptcha_widget_div{zoom: .8}

Jquery confused at the time two important for the same id. jQuery当时混淆了两个重要的同一个ID。 Remove the line width:153px !important in css and write simply width : 153px; 删除行宽:153px!在css中很重要,并简单地写出width:153px; And then try this 然后试试这个

$('#recaptcha_area') css({'width': '260px important!'});

Note : If the same property is declared in both rules, the conflict is resolved first through specificity, then according to the order of the CSS declarations. 注意:如果两个规则中都声明了相同的属性,则首先通过特定性解决冲突,然后根据CSS声明的顺序解决冲突。 The order of classes in the class attribute is not relevant. class属性中的类顺序不相关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM