2014-01-28 26 views
5

的IFRAME我需要知道在哪裏我可以改變的谷歌驗證碼碼碼這行刪除FRAMEBORDER屬性:上的Recaptcha


iframe元素上的FRAMEBORDER屬性是過時的。我想在iframe中將frameborder =「0」更改爲border:none ;.

驗證時出現錯誤,提示「iframe元素上的frameborder屬性已過時,請改用CSS」。

如何解決這個問題的任何想法?

<dd class="auto recaptcha"> 
    <p class="cap">ReCAPTCHA entry is for testing whether you are a human visitor and to prevent automated spam submissions.</p> 
    <div class="recaptcha-item"> 
     <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6LfaXscSAAAAAMcN5Mfvza9CyYfV7K5__BbQiPBN"></script> 

<noscript> 
    <iframe src="http://www.google.com/recaptcha/api/noscript?k=6LfaXscSAAAAAMcN5Mfvza9CyYfV7K5__BbQiPBN" height="300" width="500" frameborder="0"></iframe><br/> 
    <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> 
    <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/> 
</noscript>    </div> 

       <p><sup class="required">*</sup> = Required Fields</p> 
    </dd> 

Screenshot of wf4's answer

WF4的回答

+0

如果你沒有發佈任何代碼,人們不能幫你。 – Dijon

回答

2

截圖答案在你的編輯。有一個腳本,src = http://www.google.com/recaptcha/api/challenge將使用javascript在您的站點中創建一個iframe,如果腳本不可用,將使用noscript位。所以,如果你刪除

<script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6LfaXscSAAAAAMcN5Mfvza9CyYfV7K5__BbQiPBN"></script>

<noscript> </noscript>標籤,而不是內容,那麼你就可以刪除你不想要的frameborder="0"。所以你的完整代碼如下:

<dd class="auto recaptcha"> 
<p class="cap">ReCAPTCHA entry is for testing whether you are a human visitor and to prevent automated spam submissions.</p> 
<div class="recaptcha-item"> 


<iframe src="http://www.google.com/recaptcha/api/noscript?k=6LfaXscSAAAAAMcN5Mfvza9CyYfV7K5__BbQiPBN" height="300" width="500"></iframe><br/> 
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> 
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/> 
      </div> 

      <p><sup class="required">*</sup> = Required Fields</p> 
</dd> 

的造型,這也將一直使用腳本補充說,這應該是你需要什麼你head

<style type="text/css"> 
.recaptchatable td img{display:block}.recaptchatable .recaptcha_r1_c1{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') 0 -63px no-repeat;width:318px;height:9px}.recaptchatable .recaptcha_r2_c1{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') -18px 0 no-repeat;width:9px;height:57px}.recaptchatable .recaptcha_r2_c2{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') -27px 0 no-repeat;width:9px;height:57px}.recaptchatable .recaptcha_r3_c1{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') 0 0 no-repeat;width:9px;height:63px}.recaptchatable .recaptcha_r3_c2{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') -18px -57px no-repeat;width:300px;height:6px}.recaptchatable .recaptcha_r3_c3{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') -9px 0 no-repeat;width:9px;height:63px}.recaptchatable .recaptcha_r4_c1{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') -43px 0 no-repeat;width:171px;height:49px}.recaptchatable .recaptcha_r4_c2{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') -36px 0 no-repeat;width:7px;height:57px}.recaptchatable .recaptcha_r4_c4{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') -214px 0 no-repeat;width:97px;height:57px}.recaptchatable .recaptcha_r7_c1{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') -43px -49px no-repeat;width:171px;height:8px}.recaptchatable .recaptcha_r8_c1{background:url('http://www.google.com/recaptcha/api/img/red/sprite.png') -43px -49px no-repeat;width:25px;height:8px}.recaptchatable .recaptcha_image_cell center img{height:57px}.recaptchatable .recaptcha_image_cell center{height:57px}.recaptchatable .recaptcha_image_cell{background-color:white;height:57px}#recaptcha_area,#recaptcha_table{width:318px!important}.recaptchatable,#recaptcha_area tr,#recaptcha_area td,#recaptcha_area th{margin:0!important;border:0!important;padding:0!important;border-collapse:collapse!important;vertical-align:middle!important}.recaptchatable *{margin:0;padding:0;border:0;font-family:helvetica,sans-serif;font-size:8pt;color:black;position:static;top:auto;left:auto;right:auto;bottom:auto}.recaptchatable #recaptcha_image{position:relative;margin:auto}.recaptchatable #recaptcha_image #recaptcha_challenge_image{display:block}.recaptchatable #recaptcha_image #recaptcha_ad_image{display:block;position:absolute;top:0}.recaptchatable img{border:0!important;margin:0!important;padding:0!important}.recaptchatable a,.recaptchatable a:hover{cursor:pointer;outline:none;border:0!important;padding:0!important;text-decoration:none;color:blue;background:none!important;font-weight:normal}.recaptcha_input_area{position:relative!important;width:153px!important;height:45px!important;margin-left:7px!important;margin-right:7px!important;background:none!important}.recaptchatable label.recaptcha_input_area_text{margin:0!important;padding:0!important;position:static!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;background:none!important;height:auto!important;width:auto!important}.recaptcha_theme_red label.recaptcha_input_area_text,.recaptcha_theme_white label.recaptcha_input_area_text{color:black!important}.recaptcha_theme_blackglass label.recaptcha_input_area_text{color:white!important}.recaptchatable #recaptcha_response_field{width:153px!important;position:relative!important;bottom:7px!important;padding:0!important;margin:15px 0 0 0!important;font-size:10pt}.recaptcha_theme_blackglass #recaptcha_response_field,.recaptcha_theme_white #recaptcha_response_field{border:1px solid gray}.recaptcha_theme_red #recaptcha_response_field{border:1px solid #cca940}.recaptcha_audio_cant_hear_link{font-size:7pt;color:black}.recaptchatable{line-height:1!important}#recaptcha_instructions_error{color:red!important}.recaptcha_only_if_privacy{float:right;text-align:right}#recaptcha-ad-choices{position:absolute;height:15px;top:0;right:0}#recaptcha-ad-choices img{height:15px}.recaptcha-ad-choices-collapsed{width:15px;height:15px;display:block}.recaptcha-ad-choices-expanded{width:75px;height:15px;display:none}#recaptcha-ad-choices:hover .recaptcha-ad-choices-collapsed{display:none}#recaptcha-ad-choices:hover .recaptcha-ad-choices-expanded{display:block} 
.recaptcha_is_showing_audio .recaptcha_only_if_image,.recaptcha_isnot_showing_audio .recaptcha_only_if_audio,.recaptcha_had_incorrect_sol .recaptcha_only_if_no_incorrect_sol,.recaptcha_nothad_incorrect_sol .recaptcha_only_if_incorrect_sol{display:none !important} 
</style> 
+1

謝謝@ wf4它工作正常。但沒有任何樣式。是否有人知道如何在不影響初始設計的情況下將其刪除 – Mahesh

+2

我已經添加了使用腳本時從F12開發人員工具中獲取的CSS。 @MaheshWijewardhana應該爲你梳理風格。 – wf4

+0

我添加了你的CSS。但它沒有改變任何東西。 @ wf4 – Mahesh

0

確定包括,所以這裏是另一個解決方案......問題是「刪除Recaptcha的iframe上的frameborder屬性」。 這個問題肯定是由於w3c驗證器而產生的。在你的代碼中有一個腳本會將HTML注入到你的頁面中,這樣做將包括樣式化內容所需的所有HTML和CSS。 我的第一個回答是刪除這個腳本,只使用標籤中的iframe,但是,這不是問題所在。問題在於<noscript>標籤的內容,而不是實際的回覆。所以我的第二個答案是做下列之一:

答:從iframe

<iframe src="http://www.google.com/recaptcha/api/noscript?k=6LfaXscSAAAAAMcN5Mfvza9CyYfV7K5__BbQiPBN" height="300" width="500"></iframe> 

這將解決這個問題,驗證取出frameborder="0"

B:如果在腳本不可用時不想使用未格式化的表單,請刪除整個<noscript>部分。

還有其他幾種嘗試對iframe的內容進行樣式設計,但他們使用javascript和現代瀏覽器不會允許這個時,該網站不屬於同一個域的一部分。