即使我们遵循文件夹结构,如何保持css,图像,js链接? [英] How to maintain css , image , js linking even if we follow folder structure ?

查看:58
本文介绍了即使我们遵循文件夹结构,如何保持css,图像,js链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii,





我正在开发webapplication,有css,js,fonts文件夹结构..



现在这里的问题是..当我在同一个项目中创建webforms时。所有的css,js都应用得很好..



但是现在我想维护文件夹结构以进行授权,现在所有的css,js都无法访问该文件夹。所以我必须去../模式,这是非常忙碌..甚至不确定那将是所有工作,因为很多js在那里,图像也来自那里..



请在此建议

Hii ,


I am developing webapplication , have css , js , fonts folder structures ..

now the problem here is .. when i create webforms within same project . all css , js gets applied well ..

But now i want to maintain folder structure for authorization and now all the css , js gets out of reach in that folder .. so i have to go for ../ pattern which is very hectic .. and even not sure will that be all working as many js are there and images are coming from there as well ..

Please suggest on this

推荐答案

没有像奇迹这样的东西。如果你把一些文件放在不同的目录中,比如说,在其他目录中共享它们,那么文件名必须带有一些路径。使用相对路径或相对于站点根目录的路径,或混合两种方式,并考虑其含义,因为它是在几乎所有类型的软件和信息产品的情况下完成的。



我以前从未见过有人抱怨不得不关心这个基本的东西,甚至没有人把这种微不足道的决定称为模式。我只会警告你一件事:避免尝试通过使用一些配置文件等来找到一些站点全局模式。我只会使你的解决方案不那么便携和可维护。



-SA
There is no such things as miracle. If you put some files in separate directories, say, the share them in other directories, the file names have to come with some path. Use relative paths, or paths relative to the site's root directories, or mix both ways, and consider the implications, as it is done in case of nearly all kinds of software and informational products.

I never saw anyone complaining about having to take care about this basic thing before, not even anyone calling this trivial kind of decision a "pattern". I would only warn you against one thing: avoid trying to find some "site-global" pattern by using some configuration files, etc. I would only make your solution less portable and maintainable.

—SA


这篇关于即使我们遵循文件夹结构,如何保持css,图像,js链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆