简体   繁体   English

内联块在 ng-recaptcha 中留下边界

[英]Inline block leaves a border in ng-recaptcha

<div class="text-center">
          <re-captcha
           [ngClass]="{'face err-captcha': captchaResponse==false && submitted}"
          class="recaptcha" (resolved)="resolved($event)" siteKey={{captchaSiteKey}}>
          </re-captcha>
     </div>

Image图片

If I dont use inline block then that captcha block doesn't get centered.如果我不使用内联块,那么验证码块就不会居中。 When I remove it then border goes away but the captcha gets out of order.当我删除它时,边框消失,但验证码出现故障。

 .recaptcha {
  display: inline-block;
  background: #f9f9f9;
}

With black background, Image it actually not a border but looks like one.在黑色背景下, Image它实际上不是边框,而是看起来像边框。 If there is a way to center it without using inline block that might do the trick.如果有一种方法可以在不使用内联块的情况下将其居中,这可能会奏效。

.recaptcha {
  display: inline-block;
  background: #080808;
}

This is normal behavior for display: inline-block;这是显示的正常行为:inline-block; So there are some solutions to this: 1. margin-right(or any side where this space or border coming): -1px;因此,有一些解决方案: 1. margin-right(或此空间或边框所在的任何一侧):-1px;
2. font-size: 0; 2. 字体大小:0; to the parent and give deired font size in inner items给父级并在内部项目中提供所需的字体大小

  1. <div class="text-center"><re-captcha [ngClass]="{'face err-captcha': captchaResponse==false && submitted}" class="recaptcha" (resolved)="resolved($event)" siteKey={{captchaSiteKey}}></re-captcha</div>

3rd one is may be looks wired to you but this is also a cool solution.第 3 个可能看起来很像您,但这也是一个很酷的解决方案。 remove all the space and enters from your code, basically minimize it.删除所有空间并从您的代码中输入,基本上将其最小化。

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

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