stylesheet-link-tag

I'm having trouble with applying CSS to my HTML

对着背影说爱祢 提交于 2020-01-16 08:43:28
问题 I've tried inline CSS and also then changed to linking an external stylesheet but neither will load for me in any browser when I test the code. Could it be that I haven't saved my css file properly? How may I do that? With the external stylesheet (my ideal option for the website) - <!doctype html> <html lang="en"> <head> <title>My name Homepage</title> <link rel="stylesheet" type="text/css" href="styles/main.css"> </head> <body> <h1> This is My Name</h1> <h2>Welcome to my website.</h2> <p>

Stylesheet_link_tag :all versus :media =>all

风流意气都作罢 提交于 2019-12-18 11:56:06
问题 I created a new Rails application from a scaffold, but the tutorial claims the following will appear: <%= stylesheet_link_tag "application", :media => "all" %> while I got: <%= stylesheet_link_tag :all %> What is the difference between them? Which should I use? Why? 回答1: Using <%= stylesheet_link_tag "application", :media => "all" %> will include the stylesheet named application.css , you can have files like application.css.sass or application.css.scss or any other extensions and rails will

How do I link a CSS stylesheet from another folder below in the directory?

时间秒杀一切 提交于 2019-12-13 07:33:33
问题 This is what I'm trying to link into my HTML and it's not working I tried taking off the two periods and that doesn't work either. <link rel="stylesheet" style="text/css" href="..CSS/file.css"> 回答1: In your case: <link rel="stylesheet" style="text/css" href="../CSS/file.css"> More cases: You can go up directories with ../ So for each ../ you will go up 1 directory If you are in /public/files/ you can do <link rel="stylesheet" style="text/css" href="../CSS/file.css"> to get into /public/CSS/

CSS returns “Internal server error” on Heroku

好久不见. 提交于 2019-12-12 04:14:11
问题 I am using Rails 3.1.1 and have a website with a setting of stylesheets that changes over the year according to seasons etc, like this: <%= stylesheet_link_tag "application" %> <%= stylesheet_link_tag 'themes/theme_winter.css' %> with the theme_winter.css is placed in a folder called themes in the stylesheet-folder. I am using Memcachier so online it looks like this: <link href="/assets/application-75b2717254d80c8ed37d5f955e2a0287.css" media="screen" rel="stylesheet" type="text/css" /> <link

Stylesheet_link_tag :all versus :media =>all

十年热恋 提交于 2019-11-30 05:13:39
I created a new Rails application from a scaffold, but the tutorial claims the following will appear: <%= stylesheet_link_tag "application", :media => "all" %> while I got: <%= stylesheet_link_tag :all %> What is the difference between them? Which should I use? Why? Using <%= stylesheet_link_tag "application", :media => "all" %> will include the stylesheet named application.css , you can have files like application.css.sass or application.css.scss or any other extensions and rails will compile the css file with the right stylesheet engine and serve the application.css file. The attribute

no implicit conversion of nil into String

只愿长相守 提交于 2019-11-28 21:34:06
currently I'm trying to set up a simple app in Ruby on Rails. I've migrated the db, seeded it and am now stuck at the following error. no implicit conversion of nil into String Extracted source (around line #4): 1: <!--[if lt IE 9]> 2: <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> 3: <![endif]--> 4: <%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %> 5: <%= stylesheet_link_tag 'blueprint/print', :media => 'print' %> 6: <%= stylesheet_link_tag 'custom', :media => 'screen' %> It seems like the asset tags helpers are not working properly or returning nil

no implicit conversion of nil into String

大兔子大兔子 提交于 2019-11-27 13:56:28
问题 currently I'm trying to set up a simple app in Ruby on Rails. I've migrated the db, seeded it and am now stuck at the following error. no implicit conversion of nil into String Extracted source (around line #4): 1: <!--[if lt IE 9]> 2: <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> 3: <![endif]--> 4: <%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %> 5: <%= stylesheet_link_tag 'blueprint/print', :media => 'print' %> 6: <%= stylesheet_link_tag 'custom