有誰知道recaptcha是否可以在沒有默認框架的情況下完全自定義。我需要recaptcha圖像只有一定的寬度以及輸入字段。有沒有人在成功之前做過這件事。Recaptcha - Form Customization
11
A
回答
11
您可以通過您的網頁上像這樣指定使用「自定義」主題選項自定義標記:
<script type="text/javascript">
var RecaptchaOptions = {
theme : 'custom',
custom_theme_widget: 'recaptcha_widget'
};
</script>
然後您在頁面上創建一個div匹配custom_theme_widget
ID是這樣的:
<div id="recaptcha_widget">
<div id="recaptcha_image"></div>
<input type="text" id="recaptcha_response_field" name="recaptcha_response_field" />
</div>
圖像將被插入到recaptcha_image
格,因此你可以使用CSS像這樣限制了它的寬度:
#recaptcha_image img {
width: 200px;
}
...但請記住,它會調整瀏覽器中的較大圖像的大小,並可能導致驗證碼變得不可讀,所以我不一定會推薦。無論你喜歡,recaptcha_response_field
輸入也可以被設置。
請參閱「外觀和感覺自定義」一節here瞭解更多您可以(和應該)在自定義主題中執行的示例。
4
您可以創建一個自定義theme,它應該可以幫助您處理輸入字段,但我認爲您的圖像大小運氣不佳 - 它固定爲300 x 57(當然,您可以更改尺寸,但會結果在一個更加扭曲,並很可能完全不可讀,圖像)
3
http://risingofsilversurfer.blogspot.com/2009/10/customize-recaptcha-theme.html
這適用於Firefox的,雖然不知道其他的瀏覽器,如果你需要它在IE6中工作,我不認爲它接受css圖像大小的變化,所以它會看起來不合適。
1
我所做的只是更新了reCAPTCHA樣式。
以下CSS更改圖像和容器的寬度和高度。尺寸最初由Google定義,但可以通過向頁面添加新樣式進行覆蓋。
<style type="text/css">
#recaptcha_image img{
height:46px;
width:230px;
margin: 0px;
padding: 0px;
}
#recaptcha_container {
margin: 0px;
padding: 0px;
width: 230px;
}
</style>
請注意,圖像越小,用戶閱讀的難度就越大。
相關問題
- 1. Zend Form reCaptcha ViewScript裝飾器
- 2. EditText Customization
- 3. Dynamics Solomon Customization
- 4. Thingsboard UI Customization
- 5. Google FormApp Customization
- 6. Bootstrap Carousel Customization
- 7. Magento 2 Theme Customization
- 8. JQuery Sheet Customization
- 9. jQuery Datatable Filter Customization
- 10. Android:ActionBar Customization的問題
- 11. Windows CMD Customization Quest的
- 12. ipad Tabbar Customization不工作
- 13. ipad page curl control for customization
- 14. Bootstrap Drop-Down li Customization Not Working
- 15. 如何在Ant Design Form組件中使用Google reCAPTCHA?
- 16. 如何在MVC3中使用帶有Ajax Form的@ReCaptcha?
- 17. g-recaptcha-response中的空格Google的reCaptcha
- 18. 驗證NoCaptcha ReCaptcha
- 19. Google新reCaptcha
- 20. Laravel reCaptcha集成
- 21. jquery驗證reCaptcha
- 22. 問題與SfExtraFormPlugin(ReCaptcha)
- 23. 用javascript創建reCAPTCHA
- 24. PHP reCaptcha AJAX
- 25. Recaptcha「incorrect-captcha-sol」
- 26. jquery驗證reCaptcha
- 27. 添加reCAPTCHA V2
- 28. 如何設置reCAPTCHA?
- 29. Google ReCAPTCHA設置v2
- 30. reCAPTCHA與Laravel隱身