![](/img/trans.png)
[英]I want to remove staight line that shows in my blog page. It is only shows in firefox not in the chrome
[英]CSS only shows correctly on index page. Ruby On Rails
我是Ruby On Rails的新手,我正在嘗試使用css模板為項目工作。 它在我的索引頁面上運行正常但在其他每個頁面上它似乎都沒有從application.html.haml文件中獲取完整的布局。
如果我使用鏈接在頁面中包含css,它將只添加字體更改和顏色更改,但實際布局沒有任何更改,即。 表格,格式等。
= stylesheet_link_tag 'style'
我現在不確定在哪里進行故障排除,因為它只從樣式表中抓取了一半我的樣式。
!!! 5
%html
%head
%title HELPDESK
= csrf_meta_tags
%link{:href => "style.css", :rel => "stylesheet", :type => "text/css"}/
%body
%h1.title HELPDESK
#main
- if flash[:notice]
#notice.message= flash[:notice]
- elsif flash[:warning]
#warning.message= flash[:warning]
= yield
如果它有任何幫助,我可以將我的其他頁面重命名為index.html.haml並且css加載完全正常,因此頁面寫得正確我只是有一個錯誤,Rails加載樣式表的方式或路由錯誤。
tl:在site.com/questions/沒有加載正確的樣式表后,我的Rails應用程序中的所有內容,而site.com/questions加載完全正常。
謝謝!
我解決了這個問題。 我需要將application.html.haml文件(上面列出的)中的鏈接指向../style.css而不是style.css
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.