Answers.Body: <p>Are you using a relative file path? Try to omit them where you can and see if it resolves?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-13T20:23:46.103Z
Answers.Text: 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
Answers.UserDisplayName: Jessie Gilligan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-13T20:22:27.413Z
Answers.LastActivityDate: 2019-02-13T20:22:27.413Z
Answers.UserDisplayName: Jessie Gilligan
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-11T13:55:54.027Z
Comments.Text: 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".
Comments.UserDisplayName: Jon Weedin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-11T22:49:48.247Z
Comments.Text: 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.
Comments.UserDisplayName: Shabaz Khan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-12T02:09:31.363Z
Comments.Text: Do you have a 404 error in your console for the CSS file?
Comments.UserDisplayName: Jon Weedin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-12T03:43:02.103Z
Comments.Text: 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.
Comments.UserDisplayName: Shabaz Khan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-12T04:26:39.313Z
Comments.Text: 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?
Comments.UserDisplayName: Jon Weedin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-12T04:52:12.273Z
Comments.Text: 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
Comments.UserDisplayName: Shabaz Khan
Tags: <craft3><entry-slug>
Title: _entry.twig isn't reading css while index does
ThreadText: # _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  
  
  ---
  
  