Twitter Bootstrap和ReCaptcha

Eri*_*rds 2 recaptcha asp.net-mvc-4 twitter-bootstrap

我使用基本的Twitter Bootstrap .less文件作为ASP.NET MVC4网站的基本样式.我使用Microsoft.Web.Helpers.ReCaptcha类在注册页面添加了ReCaptcha.简化示例:

<head>
  <link rel="stylesheet/less" href="@Url.Content("~/scripts/less/style.less")" />
</head>

@ReCaptcha.GetHtml()
Run Code Online (Sandbox Code Playgroud)

结果如下:

混乱的ReCaptcha

如果我使用Chrome开发工具或firebug并删除twitter bootstrap,我会得到预期的ReCaptcha:

好的ReCaptcha

当然,这会破坏网站的所有其他样式,这是不可取的.有没有其他人经历过这个,有没有任何解决方案,除了手动更改引导类以添加ReCaptcha类的异常?

mef*_*ect 8

这就是为我解决的问题.在MVC 4 Web应用程序中使用Bootstrap 2.3.2.我在所有其他CSS之后添加了以下css.

.recaptchatable * {
    border: 0 !important;
}

body {
    line-height: normal !important;
}
Run Code Online (Sandbox Code Playgroud)