css not applied
See original GitHub issueI tried to apply css as stated here but no style appears in the head after rendering. Here’s how I am trying to it.
.js file
const viewsDir = `${__dirname}/Views`;
const template = new EmailTemplates({
views: {
root: viewsDir,
options: {
extension: 'ejs',
},
},
juice: true,
juiceResources: {
preserveImportant: true,
webResources: {
relativeTo: path.resolve(viewsDir),
}
}
});
In the .ejs
file, I have added:
<link rel="stylesheet" href="/style.css" data-inline="data-inline">
to the head
tag.
Issue Analytics
- State:
- Created 5 years ago
- Comments:15
Top Results From Across the Web
Why is my CSS style not being applied? - Stack Overflow
I went to solution explorer (press Ctrl+Alt+L) and searched gt.css (enter your css filename). Right click on your css filename and then on ......
Read more >How to Troubleshoot CSS Not Working - WPForms
Troubleshooting CSS · Trying a Different Browser · Asking Your Host if They Have a Cache · Trying a Different Internet Source.
Read more >How to fix CSS not linking to your HTML document
How to fix CSS not linking to your HTML document · Make sure that you add the rel attribute to the link tag...
Read more >Help! My CSS Isn't Working! - meyerweb.com
Help! My CSS Isn't Working! · First, Be Sure You're Right · Too Many Spaces · Too Much HTML · External Problems ·...
Read more >CSS Style Not Being Applied (Example) | Treehouse Community
Okay so at first glance, I see two possible problems. In your HTML the link for your font has a space in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Perhaps set
const dir = path.resolve(viewsDir)
and thenconsole.log('dir', dir);
to make sure that the path to theviewsDir
is correct. Sometimes it is different based off what directory you start the process from.I know that I am like 1 year and a half late to the party, but I had this error and I fixed it.
seems like you nested this
under
views
Instead on the example code on the docs is on the root object. This might have been the error.