I’m having trouble with the CSS acess using express-handlebars. I can’t see the problem and I would like to have your help.
Here is my Workspace:
In my home.handlebars:
<link rel="stylesheet" href= "css/home.css">
In my home.css:
background-color: blue; }
Instead of showing a blue background as I ask for, it shows nothing:
<footer> <font size = 4> <h5>© 2019 Suplementos Atlética</h5> </font> </footer>
In expresss, you have to set express static. It Will looks like this code below:
if your public folder is inside src folder use below method
Now, you can create a
public folder in your root app and
css folder in your public folder and put your style into there.
So, your directory with looks like this:
- public > css > home.css
How to use? You can call your link like this:
<link rel="stylesheet" href= "/css/home.css">
For an example, you can look at my example project here: https://codesandbox.io/s/elegant-fog-1n61o
I hope it can help you.
Answered By – Titus Sutio Fanpula