首页 文章

Webstorm流星CSS背景图像位置

提问于
浏览
0

到目前为止,我已经熟悉流星并喜欢它 . 我选择的IDE是Webstorm(PHPStorm),我遇到了一个烦恼,我想知道是否有人有解决方案 .

基本上Meteor在提供来自 /public 目录的文件时实现了魔力,因为你可以在服务时将其关闭,比如在这种情况下是图像 . 所以让我们想象一下我有这样的结构:

- public
  - images
    - test.png

我的CSS文件中有这个规则:

.some-class{
  background: url('/images/test.png') no-repeat center center;
}

当然Meteor显示图像正常,但Webstorm将其视为丢失文件,在CSS文件中引发错误 . (Webstorm会期待 /public/images/test.png ) .

Is there some way to workaround this so I can avoid the squigglies every time I am entering images? 它's a useful feature when it works to let me know I muffed an image path but it appears in this configuration I'注定总是让我的CSS文件中的路径显得破碎 .

只是好奇是否有人找到了一种方法来解决这个问题,而不必采取严厉的关闭检查的路线 .

谢谢大家!

1 回答

  • 0

    这是软件问题,但您的解决方案是:

    Settings -> editor -> inspections then on right panel select css -> invalid element -> uncheck unknown file or directory
    

    Edited after comment:

    Webstorm: “Cannot Resolve Directory”

相关问题