I'm wondering what application.css
is for? If I'm creating a new file for header
and footer
so all my pages can just include header
and footer
page, do I just put all common css syntax in application.css
? or should I just create a new custom.css
and place all the syntax that is going to be used throughout my application like body, html, ul, a, tags and stuff?
Thanks
What is application.css
for? Have you read the Rails guide on the Asset Pipeline ? That page alone answers your "what's it for?" question and more very clearly and thoroughly.
As for placement of your styling, the guide mentions:
The default matcher for compiling files includes application.js, application.css and all non-JS/CSS files (ie, .coffee and .scss files are not automatically included as they compile to JS/CSS):
This means by default Rails is only going to compile an application.css
file for you. Sure, you can put your styling in app/assets/stylesheets/custom.css
and include it with
/**
*= require custom
*/
but your "custom" styling sounds like application styling, so it seems it'd be best to just drop it all into application.css
and let Rails do what it does by default.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.