Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么localhost:3000呈现css与我的应用程序在Heroku上的呈现方式不同?_Html_Css_Ruby On Rails 3_Heroku_Github - Fatal编程技术网

Html 为什么localhost:3000呈现css与我的应用程序在Heroku上的呈现方式不同?

Html 为什么localhost:3000呈现css与我的应用程序在Heroku上的呈现方式不同?,html,css,ruby-on-rails-3,heroku,github,Html,Css,Ruby On Rails 3,Heroku,Github,在本地运行的localhost:3000(rails服务器)中检查我的GUI时,一切看起来都正常,但当我将代码推到Github,然后推到Heroku时,CSS的呈现方式似乎有所不同。具体来说,我遇到的问题是css的这一点: #searchfield { float: left; left: 10%; top: 1em; position:relative; } 以及视图中的代码: <div id="searchfield"> <form

在本地运行的localhost:3000(rails服务器)中检查我的GUI时,一切看起来都正常,但当我将代码推到Github,然后推到Heroku时,CSS的呈现方式似乎有所不同。具体来说,我遇到的问题是css的这一点:

#searchfield {
    float: left;
    left: 10%;
    top: 1em;
    position:relative;
}
以及视图中的代码:

<div id="searchfield">
    <form method="get" action="http://www.amongu.com/search.rb"> 
        <input type="text" name="search" size="40px" placeholder="Search"> 
    </form>
</div>

您的CSS是内嵌在
标题中还是由
链接
标记引用?如果是标签,请告诉我们代码。我不认为是CSS。开始一个新项目,慢慢地从旧项目中添加一些东西,直到它中断。试着打破它。创建一个.Kevin-因为我是在rails中开发的,所以我有一个单独的带有css的样式表和另一个带有html和ruby的文件,并且它是自动链接的-我想这就是你的意思?Bookcasey-我会努力解决这个问题。添加了我的布局助手,这就是你所指的吗?你通过Firebug运行了吗?css文件正在heroku上加载吗?你试过另一种(更简单的)div风格吗?
# These helper methods can be called in your template to set variables to be used in the layout
# This module should be included in all views globally,
# to do so you may need to add this line to your ApplicationController
#   helper :layout
module LayoutHelper
  def title(page_title, show_title = true)
    content_for(:title) { h(page_title.to_s) }
    @show_title = show_title
  end

  def show_title?
    @show_title
  end

  def stylesheet(*args)
    content_for(:head) { stylesheet_link_tag(*args) }
  end

  def javascript(*args)
    content_for(:head) { javascript_include_tag(*args) }
  end

end