简体   繁体   English

Twitter引导程序未正确显示

[英]Twitter bootstrap not displaying right

So I'm looking for this: http://twitter.github.com/bootstrap/base-css.html#forms the Inline form .form-inline 所以我正在寻找这个: http : //twitter.github.com/bootstrap/base-css.html#forms内联表单.form-inline

Now on my page the inputs look wired like they have no padding: 现在在我的页面上,输入看起来像没有填充的连线:

Live example: here: http://jsbin.com/ariret/1/edit 实时示例:此处: http : //jsbin.com/ariret/1/edit

Here is my code: 这是我的代码:

      <div class="navbar">
        <div class="navbar-inner">
          <form class="form-inline" action="<?php echo $this->baseUrl('login'); ?>" id="form-login" method="post">
            <input type="text" class="input-small" id="email" name="email-login" placeholder="<?=$this->translate('Email');?>">
            <input type="password" class="input-small" id="password" name="password-login"  placeholder="<?=$this->translate('Password');?>">
            <label class="checkbox">
              <input type="checkbox" name="keep-logged" value="1" id="check-logged"> <?=$this->translate('Remember me'); ?>
            </label>
            <input type="hidden" name="login_type" value="normal" />
            <button type="submit" class="btn"><?=$this->translate('Login');?></button>
          </form>
        </div><!-- end navbar-iner -->
      </div><!-- end navbar -->

And here is, how it looks like: 这是它的样子:

在此处输入图片说明
It needs to have the same height as the login button. 它必须具有与登录按钮相同的高度。 I have the css and js files included on my page! 我的页面上包含css和js文件!

This appears to be a JSbin bug with Bootstrap. 这似乎是Bootstrap的JSbin错误。 Other test sites (and local host) show this to work as expected. 其他测试站点(和本地主机)显示此功能可以正常工作。

Bootstrap is setting the height of the input fields to 20px, yet it is not getting applied. Bootstrap将输入字段的高度设置为20px,但尚未应用。 The answer is not clear, but you can always head over to https://github.com/remy/jsbin/issues/new and file a new Issue. 答案尚不清楚,但是您始终可以转到https://github.com/remy/jsbin/issues/new并提交新的Issue。

" It needs to have the same height as the login button. I have the css and js files included on my page! " 它的高度必须与登录按钮的高度相同。我的页面中包含css和js文件!

<button type="submit" class="btn btn-primary btn-mini">login</button>

will reduce the height of the button to (almost) the height of the inputs 会将按钮的高度减小到(几乎)输入的高度

If you want to increase the height of the inputs to align the button, I suggest you locally override the css 如果要增加输入的高度以使按钮对齐,建议您在本地覆盖CSS

<style type="text/css">
.form-inline .input-small {
  height: 30px;
  margin-top: 3px;
}
</style>

both "solutions" works in the jsbin example - http://jsbin.com/ariret/4/edit 两者的“解决方案”工作在jsbin例子- http://jsbin.com/ariret/4/edit

You can create the following way : 您可以创建以下方式:

Jsfiddle Working inline bootstrap form Jsfiddle Working内联引导表格

Result in browser Jsfiddle in browser 在浏览器中的结果Jsfiddle在浏览器中

<div class="navbar">
        <div class="navbar-inner">
            <div class="container-fluid">
                <div class="nav row-fluid">

                        <form class="form-inline pull-right">
                            <input type="text" placeholder="email or username" />
                            <input type="password" placeholder="password" />
                            <label class="checkbox">
          <input type="checkbox" name="keep-logged" value="1" id="check-logged"> <?=$this->translate('Remember me'); ?>
        </label>
        <input type="hidden" name="login_type" value="normal" />
                            <button type="submit" class="btn">login</button>
                        </form>

                </div>
            </div>
        </div>
    </div>

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

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