how to hide the border of a recaptcha v2.0 widget?












2















I want to hide the border of a recaptcha v2.0 widget so that I can better visually integrate it into my site's look and feel.



NOTE: I'm posting this as a question, and providing a solution, because most of the StackOverflow questions I've found on the topic center around removing the frameborder attribute of the recaptcha's iframe, which isn't technically what I'm after. I'm after the result of that -- an edgeless recaptcha widget that I can position within a larger visual context.



I hope this is helpful!










share|improve this question



























    2















    I want to hide the border of a recaptcha v2.0 widget so that I can better visually integrate it into my site's look and feel.



    NOTE: I'm posting this as a question, and providing a solution, because most of the StackOverflow questions I've found on the topic center around removing the frameborder attribute of the recaptcha's iframe, which isn't technically what I'm after. I'm after the result of that -- an edgeless recaptcha widget that I can position within a larger visual context.



    I hope this is helpful!










    share|improve this question

























      2












      2








      2








      I want to hide the border of a recaptcha v2.0 widget so that I can better visually integrate it into my site's look and feel.



      NOTE: I'm posting this as a question, and providing a solution, because most of the StackOverflow questions I've found on the topic center around removing the frameborder attribute of the recaptcha's iframe, which isn't technically what I'm after. I'm after the result of that -- an edgeless recaptcha widget that I can position within a larger visual context.



      I hope this is helpful!










      share|improve this question














      I want to hide the border of a recaptcha v2.0 widget so that I can better visually integrate it into my site's look and feel.



      NOTE: I'm posting this as a question, and providing a solution, because most of the StackOverflow questions I've found on the topic center around removing the frameborder attribute of the recaptcha's iframe, which isn't technically what I'm after. I'm after the result of that -- an edgeless recaptcha widget that I can position within a larger visual context.



      I hope this is helpful!







      html css recaptcha






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 23 '16 at 22:40









      DaveDave

      1,25531218




      1,25531218
























          2 Answers
          2






          active

          oldest

          votes


















          0














          I wanted to hide the borders of a v2.0 ReCaptcha (the one with the "I'm not a robot" checkbox), and solved it as follows:



          Wrap the recaptcha div (the one that is marked with the class "g-recaptcha") with another div, and size it a bit smaller than the iframe comes in at, and shift the iframe using position: relative and left: -10px, to hide the borders.



          If you're using the "compact" version, you'll need to adjust the sizing... the css I provide works for the "normal" version.



          NOTE: Tested on Safari 9.1.2 (OSX) only, but I'd guess the technique will translate to other browsers too.



          Hope this helps!



          html:



          <div class="my-div"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div>


          css:



          .my-div {
          display: inline-block;
          overflow: hidden;
          width: 290px; /* note the embedded iframe is 302x76 */
          height: 74px;
          text-align: left;
          }

          .my-div iframe {
          position: relative;
          left: -10px;
          }





          share|improve this answer































            0














            NOTE: for people brought here by google but with different problem



            If you want to hide just borders not making it edge less keeping original design just do following:



            HTML:



            <div class="captcha"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div></div>


            CSS:



            .captcha iframe {
            position: relative;
            box-shadow: none !important;
            }





            share|improve this answer

























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39111785%2fhow-to-hide-the-border-of-a-recaptcha-v2-0-widget%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              I wanted to hide the borders of a v2.0 ReCaptcha (the one with the "I'm not a robot" checkbox), and solved it as follows:



              Wrap the recaptcha div (the one that is marked with the class "g-recaptcha") with another div, and size it a bit smaller than the iframe comes in at, and shift the iframe using position: relative and left: -10px, to hide the borders.



              If you're using the "compact" version, you'll need to adjust the sizing... the css I provide works for the "normal" version.



              NOTE: Tested on Safari 9.1.2 (OSX) only, but I'd guess the technique will translate to other browsers too.



              Hope this helps!



              html:



              <div class="my-div"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div>


              css:



              .my-div {
              display: inline-block;
              overflow: hidden;
              width: 290px; /* note the embedded iframe is 302x76 */
              height: 74px;
              text-align: left;
              }

              .my-div iframe {
              position: relative;
              left: -10px;
              }





              share|improve this answer




























                0














                I wanted to hide the borders of a v2.0 ReCaptcha (the one with the "I'm not a robot" checkbox), and solved it as follows:



                Wrap the recaptcha div (the one that is marked with the class "g-recaptcha") with another div, and size it a bit smaller than the iframe comes in at, and shift the iframe using position: relative and left: -10px, to hide the borders.



                If you're using the "compact" version, you'll need to adjust the sizing... the css I provide works for the "normal" version.



                NOTE: Tested on Safari 9.1.2 (OSX) only, but I'd guess the technique will translate to other browsers too.



                Hope this helps!



                html:



                <div class="my-div"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div>


                css:



                .my-div {
                display: inline-block;
                overflow: hidden;
                width: 290px; /* note the embedded iframe is 302x76 */
                height: 74px;
                text-align: left;
                }

                .my-div iframe {
                position: relative;
                left: -10px;
                }





                share|improve this answer


























                  0












                  0








                  0







                  I wanted to hide the borders of a v2.0 ReCaptcha (the one with the "I'm not a robot" checkbox), and solved it as follows:



                  Wrap the recaptcha div (the one that is marked with the class "g-recaptcha") with another div, and size it a bit smaller than the iframe comes in at, and shift the iframe using position: relative and left: -10px, to hide the borders.



                  If you're using the "compact" version, you'll need to adjust the sizing... the css I provide works for the "normal" version.



                  NOTE: Tested on Safari 9.1.2 (OSX) only, but I'd guess the technique will translate to other browsers too.



                  Hope this helps!



                  html:



                  <div class="my-div"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div>


                  css:



                  .my-div {
                  display: inline-block;
                  overflow: hidden;
                  width: 290px; /* note the embedded iframe is 302x76 */
                  height: 74px;
                  text-align: left;
                  }

                  .my-div iframe {
                  position: relative;
                  left: -10px;
                  }





                  share|improve this answer













                  I wanted to hide the borders of a v2.0 ReCaptcha (the one with the "I'm not a robot" checkbox), and solved it as follows:



                  Wrap the recaptcha div (the one that is marked with the class "g-recaptcha") with another div, and size it a bit smaller than the iframe comes in at, and shift the iframe using position: relative and left: -10px, to hide the borders.



                  If you're using the "compact" version, you'll need to adjust the sizing... the css I provide works for the "normal" version.



                  NOTE: Tested on Safari 9.1.2 (OSX) only, but I'd guess the technique will translate to other browsers too.



                  Hope this helps!



                  html:



                  <div class="my-div"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div>


                  css:



                  .my-div {
                  display: inline-block;
                  overflow: hidden;
                  width: 290px; /* note the embedded iframe is 302x76 */
                  height: 74px;
                  text-align: left;
                  }

                  .my-div iframe {
                  position: relative;
                  left: -10px;
                  }






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 23 '16 at 22:40









                  DaveDave

                  1,25531218




                  1,25531218

























                      0














                      NOTE: for people brought here by google but with different problem



                      If you want to hide just borders not making it edge less keeping original design just do following:



                      HTML:



                      <div class="captcha"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div></div>


                      CSS:



                      .captcha iframe {
                      position: relative;
                      box-shadow: none !important;
                      }





                      share|improve this answer






























                        0














                        NOTE: for people brought here by google but with different problem



                        If you want to hide just borders not making it edge less keeping original design just do following:



                        HTML:



                        <div class="captcha"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div></div>


                        CSS:



                        .captcha iframe {
                        position: relative;
                        box-shadow: none !important;
                        }





                        share|improve this answer




























                          0












                          0








                          0







                          NOTE: for people brought here by google but with different problem



                          If you want to hide just borders not making it edge less keeping original design just do following:



                          HTML:



                          <div class="captcha"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div></div>


                          CSS:



                          .captcha iframe {
                          position: relative;
                          box-shadow: none !important;
                          }





                          share|improve this answer















                          NOTE: for people brought here by google but with different problem



                          If you want to hide just borders not making it edge less keeping original design just do following:



                          HTML:



                          <div class="captcha"><div class="g-recaptcha" data-size="normal" data-sitekey="<your site key>"></div><div></div>


                          CSS:



                          .captcha iframe {
                          position: relative;
                          box-shadow: none !important;
                          }






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Nov 14 '18 at 14:33

























                          answered Nov 14 '18 at 11:32









                          Nikita SeliverstovNikita Seliverstov

                          677




                          677






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39111785%2fhow-to-hide-the-border-of-a-recaptcha-v2-0-widget%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Xamarin.iOS Cant Deploy on Iphone

                              Glorious Revolution

                              Dulmage-Mendelsohn matrix decomposition in Python