<p>Is your css file located in the <code>/resources/</code> folder of your plugin? So your path should be something like:</p>

<pre><code>&lt;plugin folder&gt;/resources/css/sitemaphtml.css
</code></pre>

<p>I've tried it myself and whilst you do get the <code>/cpresources/</code> part of the Url in your markup, the CSS file is loaded on the front end.</p>

<p>EDIT: If you take a look in the <a href="https://craftcms.com/docs/plugins/resources" rel="nofollow">docs</a>, it says the following:</p>

<blockquote>
  <p>By default, Craft will search for the resource file in its own
  craft/app/resources/ folder. If it can’t find the file there, it will
  check if the first segment of the resource path is set to a plugin
  handle. If it is, Craft will look for the resource file within that
  plugin’s resources/ folder.</p>
</blockquote>

CC BY-SA 3.0
2016-03-16T13:17:43.183Z
That was it all along, thank oyu very much for your help.
jmack
CC BY-SA 3.0
2016-03-16T13:29:31.330Z
No worries, I've done it myself :)
Steve Holland
CC BY-SA 3.0
2016-03-16T11:39:36.837Z
2016-03-16T17:53:57.907Z
2016-03-16T17:53:57.907Z
Steve Holland
<p>Hey guys I have created a plugin with an accompanying Stylesheet which I am adding to the page via </p>

<pre><code>class SitemaphtmlPlugin extends BasePlugin
{

function init(){

     craft()-&gt;templates-&gt;includeCssResource('sitemaphtml/css/sitemaphtml.css');
}
</code></pre>

<p>however the link being generated is prefixing the path with cpresources/ making it 404.</p>

<pre><code>/cpresources/sitemaphtml/css/sitemaphtml.css?x=xXhFyszUs 
</code></pre>

<p>how can i overcome this this?</p>

<p>Cheers</p>

CC BY-SA 3.0
2016-03-15T17:15:58.103Z
Are you trying to get the CSS file to load in the control panel or on the front-end of a site?
Brad Bell
CC BY-SA 3.0
2016-03-16T09:29:31.707Z
Hi thanks for the reply, I am trying to get the CSS to load on the front-end of the site. Cheers
jmack
<plugin-development><assets><css>
Plugin Stylesheet 404
# Plugin Stylesheet 404

(Asked by: username_0 on 2016-03-15)

Hey guys I have created a plugin with an accompanying Stylesheet which I am adding to the page via 
class SitemaphtmlPlugin extends BasePlugin
{

function init(){

     craft()->templates->includeCssResource('sitemaphtml/css/sitemaphtml.css');
}

however the link being generated is prefixing the path with cpresources/ making it 404.
/cpresources/sitemaphtml/css/sitemaphtml.css?x=xXhFyszUs 

how can i overcome this this?
Cheers

**Tags:** plugin-development, assets, css
> **Comments:**
> **username_1**: Are you trying to get the CSS file to load in the control panel or on the front-end of a site?  
> **username_0**: Hi thanks for the reply, I am trying to get the CSS to load on the front-end of the site. Cheers  

---

## 1 answers

### Answer by username_2 on 2016-03-16. Score: 2 | Accepted answer

Is your css file located in the /resources/ folder of your plugin? So your path should be something like:
/resources/css/sitemaphtml.css

I've tried it myself and whilst you do get the /cpresources/ part of the Url in your markup, the CSS file is loaded on the front end.
EDIT: If you take a look in the docs, it says the following:

By default, Craft will search for the resource file in its own
  craft/app/resources/ folder. If it can’t find the file there, it will
  check if the first segment of the resource path is set to a plugin
  handle. If it is, Craft will look for the resource file within that
  plugin’s resources/ folder.

> **Comments:**
> **username_0**: That was it all along, thank oyu very much for your help.  
> **username_2**: No worries, I've done it myself :)  

---

