Note that there are some explanatory texts on larger screens.

plurals
  1. PORails CSS loads, but style isn't applied
    primarykey
    data
    text
    <p>I'm following the book <a href="http://pragprog.com/book/rails4/agile-web-development-with-rails" rel="nofollow">http://pragprog.com/book/rails4/agile-web-development-with-rails</a> and my scss files aren't working.</p> <p>The css file is this one:</p> <pre><code>.store { h1 { margin: 0; padding-bottom: 0.5em; font: 150% sans-serif; color: #226; border-bottom: 3px dotted #77d; } /* An entry in the store catalog */ .entry { overflow: auto; margin-top: 1em; border-bottom: 1px dotted #77d; min-height: 100px; img { width: 80px; margin-right: 5px; margin-bottom: 5px; position: absolute; } h3 { font-size: 120%; font-family: sans-serif; margin-left: 100px; margin-top: 0; margin-bottom: 2px; color: #227; } p, div.price_line { margin-left: 100px; margin-top: 0.5em; margin-bottom: 0.8em; } .price { color: #44a; font-weight: bold; margin-right: 3em; } } } </code></pre> <p>and the html file the following:</p> <pre><code>&lt;% if notice %&gt; &lt;p id="notice"&gt;&lt;%= notice %&gt;&lt;/p&gt; &lt;% end %&gt; &lt;h1&gt;Your Pragmatic Catalog&lt;/h1&gt; &lt;% @products.each do |product| %&gt; &lt;div class="entry"&gt; &lt;%= image_tag(product.image_url) %&gt; &lt;h3&gt;&lt;%= product.title %&gt;&lt;/h3&gt; &lt;p&gt;&lt;%= sanitize(product.description) %&gt;&lt;/p&gt; &lt;div class="price_line"&gt; &lt;span class="price"&gt;&lt;%= product.price %&gt;&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;% end %&gt; </code></pre> <p>The CSS is loading properly, but not being applied. However if add a surrounding div with the class "store" it works. The book doesn't refer this situation, and I believe it should "automatically" apply the style, right?</p> <p>Thanks.</p> <p><em><strong></em>**</strong><em>EDIT</em><strong><em>*</em>**<em>*</em>****</strong></p> <p>I found the problem. For those who may encounter the same issue, check the file:</p> <p>app/assets/views/layouts/application.html.erb</p> <p><strong>body</strong> tag should have the following code:</p> <pre><code>&lt;body class="&lt;%= controller.controller_name %&gt;"&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload