bootstrap nav pull-right使标题缩小屏幕

时间:2013-07-11 00:12:22

标签: css ruby-on-rails-3 mobile twitter-bootstrap

在放大移动设备时,标题也会被放大,因此我的标题部分(类导航右拉)会从屏幕上切下。我怎样才能解决这个问题? perhap将标题大小固定到屏幕的宽度?

  <nav>
    <ul class="nav pull-right">
      <div class="signinform" <% if request.path == root_path && current_user.nil? %> style="padding-top: 18px;" <% end %>>
          <%= form_for(:session, url: sessions_path, :html => { :class => "form-inline"}) do |f| %>
              <input id="session_email" name="session[email]" type="text" class="input-medium" placeholder="Email">
              <input id="session_password" name="session[password]" type="password" class="input-medium" placeholder="Password">
              <button type="submit" class="btn btn-small btn-primary">Sign in</button>
          <% end %>
      </div>
    </ul>
  </nav>

1 个答案:

答案 0 :(得分:4)

当我使用bootstrap作为标题时,我实际上从这个youtube视频中获得了所需的所有信息。 https://www.youtube.com/watch?v=gPbp1JecLuU&list=FL5jJgNXjcYi4i0QKFe1-NKw&index=3

问题是Bootstrap标头必须以某种方式完成才能使一切工作。像动态调整大小的事情取决于它是以ceratin方式完成的。这是标题应该一般工作的方式,但是,你应该看看youtube视频。

祝你好运!

<div class="navbar">
  <div class="navbar-inner">
   <div class="container">
    <div class="nav pull-right">
     <div class="signinform" <% if request.path == root_path && current_user.nil? %> style="padding-top: 18px;" <% end %>>
      <%= form_for(:session, url: sessions_path, :html => { :class => "form-inline"}) do |f| %>
          <input id="session_email" name="session[email]" type="text" class="input-medium" placeholder="Email">
          <input id="session_password" name="session[password]" type="password" class="input-medium" placeholder="Password">
          <button type="submit" class="btn btn-small btn-primary">Sign in</button>
      <% end %>
     </div>
    </div>
   </div>
  </div>
 </div> <!-- closes class navbar -->