<p>Are you using a relative file path? Try to omit them where you can and see if it resolves?</p>

CC BY-SA 4.0
2019-02-13T20:23:46.103Z
I typically use {{ siteUrl }} before ANY relative path to avoid the hassle. I recommend it for all templates that use any kind of directory for static images or for js or css called in multiple places with multiple layouts
Jessie Gilligan
CC BY-SA 4.0
2019-02-13T20:22:27.413Z
2019-02-13T20:22:27.413Z
Jessie Gilligan
<p>This is the template im using and the index of the file is taking the css and printing it nicely however, the _entry.twig is only loading text, please check out the screenshots.</p>

<p>Below is the index of directory which loads css completely fine.</p>

<p>And one after is the _entry.twig which isn't taking any CSS.
<a href="https://i.sstatic.net/TTAej.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TTAej.png" alt="index of the directory"></a></p>

<p><a href="https://i.sstatic.net/oBzop.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oBzop.png" alt="This is _entry.twig of the same directory which isn&#39;t loadingany css"></a></p>

<p>Thanks!</p>

CC BY-SA 4.0
2019-02-11T13:55:54.027Z
Is your _entry.twig template using `{% extends '_layout' %}` at the top? Either that, or the <style> tag in your layout is using a relative link like "/style.css" instead of an exact link like "{{ siteUrl }}style.css".
Jon Weedin
CC BY-SA 4.0
2019-02-11T22:49:48.247Z
Thank you for the reply. _entry.twig does have {%extends '_layout' %} at the top, and style tag in the header is as follows <link rel="stylesheet" href = "css/styles.css">. the css directory is in web folder, and its taking style in index but not in _entry.twig. NOTE : css style is being fetched in other _entry.twig of single page.
Shabaz Khan
CC BY-SA 4.0
2019-02-12T02:09:31.363Z
Do you have a 404 error in your console for the CSS file?
Jon Weedin
CC BY-SA 4.0
2019-02-12T03:43:02.103Z
I tried doin' this copied style.css from css/style.css and pasted it in template directory and under layouts/_main i changed the path from <link rel="stylesheet" href = "css/styles.css"> to <link rel="stylesheet" href = "/styles.css">. as a result now when I hit _entry.twig slug the page just keeps loading, not sure if this qualifies to be 404 error.
Shabaz Khan
CC BY-SA 4.0
2019-02-12T04:26:39.313Z
Your styles.css file should be in your web folder, not in templates. When the styles.css file is in your web folder, if you open up Developer Tools and click Console, do you see a red 404 error that it can't find your styles.css file?
Jon Weedin
CC BY-SA 4.0
2019-02-12T04:52:12.273Z
ok just adding ../ before the <link rel="stylesheet" href = "css/styles.css"> to .//css/styles.css in _layouts/_main seem to have solved the issue, having a look through console helped me identify the problem. many thanks
Shabaz Khan
<craft3><entry-slug>
_entry.twig isn't reading css while index does
# _entry.twig isn't reading css while index does

(Asked by: username_0 on 2019-02-11)

This is the template im using and the index of the file is taking the css and printing it nicely however, the \_entry.twig is only loading text, please check out the screenshots.

Below is the index of directory which loads css completely fine.

And one after is the \_entry.twig which isn't taking any CSS.
[![index of the directory](https://i.sstatic.net/TTAej.png)](https://i.sstatic.net/TTAej.png)

[![This is _entry.twig of the same directory which isn't loadingany css](https://i.sstatic.net/oBzop.png)](https://i.sstatic.net/oBzop.png)

Thanks!

**Tags:** craft3, entry-slug

> **Comments:**
> **username_1**: Is your _entry.twig template using `{% extends '_layout' %}` at the top? Either that, or the <style> tag in your layout is using a relative link like "/style.css" instead of an exact link like "{{ siteUrl }}style.css".  
> **username_0**: Thank you for the reply. _entry.twig does have {%extends '_layout' %} at the top, and style tag in the header is as follows <link rel="stylesheet" href = "css/styles.css">. the css directory is in web folder, and its taking style in index but not in _entry.twig. NOTE : css style is being fetched in other _entry.twig of single page.  
> **username_1**: Do you have a 404 error in your console for the CSS file?  
> **username_0**: I tried doin' this copied style.css from css/style.css and pasted it in template directory and under layouts/_main i changed the path from <link rel="stylesheet" href = "css/styles.css"> to <link rel="stylesheet" href = "/styles.css">. as a result now when I hit _entry.twig slug the page just keeps loading, not sure if this qualifies to be 404 error.  
> **username_1**: Your styles.css file should be in your web folder, not in templates. When the styles.css file is in your web folder, if you open up Developer Tools and click Console, do you see a red 404 error that it can't find your styles.css file?  
> **username_0**: ok just adding ../ before the <link rel="stylesheet" href = "css/styles.css"> to .//css/styles.css in _layouts/_main seem to have solved the issue, having a look through console helped me identify the problem. many thanks  

---

## 1 answers

### Answer by username_2 on 2019-02-13. Score: 1 | Accepted answer

Are you using a relative file path? Try to omit them where you can and see if it resolves?

> **Comments:**
> **username_2**: I typically use {{ siteUrl }} before ANY relative path to avoid the hassle. I recommend it for all templates that use any kind of directory for static images or for js or css called in multiple places with multiple layouts  

---

