简体   繁体   English

Ruby on Rails CSS

[英]ruby on rails css

I'm trying to color my view using css. 我正在尝试使用CSS为我的视图着色。 The controller is workflows_controller. 控制器为workflows_controller。 Hence i added the following code to the workflows.css.scss: 因此,我在工作流中添加了以下代码:css.scss:

.folder_section {
  text-align:center;
  color: #244;
}

My view is 我的看法是

<div class="folder_section" id="folder_section">
                <%= form_for :folder_name, :remote => true, :method => "get", :url => {:action => "show"} do |f| %>
                <%= f.select :foldernames, options_for_select(@folders, @folders.first)%>
                <%= f.submit "Submit folder"%>
                <% end%>
</div>

The select box is aligned to the center but i could not see any color. 选择框与中心对齐,但我看不到任何颜色。 I copy pasted the same code in the view itself. 我在视图本身中复制粘贴了相同的代码。 But still i could not see any color. 但是我仍然看不到任何颜色。 Please let me know why the select box is aligned to the center but not colored. 请让我知道为什么选择框与中心对齐但未着色。 I looked into the web and some pdf documents. 我查看了网络和一些pdf文档。 Everyone says that the controller.css.scss will take care of styling when you add the css code to it. 每个人都说,当您将css代码添加到controller.css.scss时,它将注意样式。 Thanks 谢谢

The css color attribute is for setting the font color and the color you chose is quite close to black so you may not see a change. css color属性用于设置字体颜色,并且您选择的颜色与黑色非常接近,因此您可能看不到更改。

Have you tried to set the background-color attribute to #244 ? 您是否尝试将background-color属性设置为#244

Or try to change the select field color attribute by defining it in the code 或者尝试通过在代码中定义来更改选择字段颜色属性

.folder_section { 
  select {
    color: #244; 
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM