开发者

C# MVC: using CSS from another location

开发者 https://www.devze.com 2022-12-09 03:14 出处:网络
I need to keep all images, css, etc in one folder structure and all code in another. I\'m trying to get the src paths right and just cannot do it.

I need to keep all images, css, etc in one folder structure and all code in another. I'm trying to get the src paths right and just cannot do it.

I have css in the following structure: /public/content/*.css and all project code in this: /protected/Code/... And public and开发者_运维问答 protected are in the same folder.

How do I use the public resource in the protected projects?

Cheers,


This sounds like something where you need relative path names. For instance, if you are inside folder/protected/Code and you need to access folder/public/content/main.css, you would use the path ../../public/content/main.css

Inside folder/protected/Code, .. refers to folder/protected, and ../.. refers to folder.

0

精彩评论

暂无评论...
验证码 换一张
取 消