【问题标题】:My header covers what I want to make appear.我的标题涵盖了我想要显示的内容。
【发布时间】:2016-04-18 08:11:06
【问题描述】:

我跑了rails generate scaffold pins description:string。接头覆盖引脚如下。我不知道如何解决这个问题。我用 css 尝试了一些,但没有用。有谁知道这方面的解决方案?

【问题讨论】:

  • 请发布您的html和css代码
  • <p id="notice"><%= notice %></p> <h1>Listing Pins</h1> <table> <thead> <tr> <th>Description</th> <th colspan="3"></th> </tr> </thead> <tbody> <% @pins.each do |pin| %> <tr> <td><%= pin.description %></td> <td><%= link_to 'Show', pin %></td> <td><%= link_to 'Edit', edit_pin_path(pin) %></td> <td><%= link_to 'Destroy', pin, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% end %> </tbody> </table> <br> <%= link_to 'New Pin', new_pin_path %>
  • 你说你尝试了一些css,也发布了。也发布布局文件的内容。将它们添加到您的问题中,而不是 cmets。

标签: css ruby-on-rails


【解决方案1】:

您可以尝试将margin-top 应用于页面内容。页边距应与页眉高度相同或更高。

【讨论】:

    【解决方案2】:

    我假设您使用的是引导导航栏 - 您需要添加填充以避免重叠 - 来自 navbar docs

    Add .navbar-fixed-top and include a .container or .container-fluid to center and pad navbar content.
    
    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        ...
      </div>
    </nav>
    

    需要身体填充

    固定导航栏将覆盖您的其他内容,除非您在&lt;body&gt; 的顶部添加填充。试试你自己的价值观或使用我们下面的 sn-p。提示:默认情况下,导航栏的高度为 50px。

    body { padding-top: 70px; }
    

    确保在核心 Bootstrap CSS 之后包含它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-26
      • 2015-11-02
      • 2012-06-18
      • 2018-02-08
      • 1970-01-01
      • 2019-04-06
      相关资源
      最近更新 更多