Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css Compass正在向我的数据uri添加路径_Css_Sass_Compass Sass - Fatal编程技术网

Css Compass正在向我的数据uri添加路径

Css Compass正在向我的数据uri添加路径,css,sass,compass-sass,Css,Sass,Compass Sass,我在我的项目中使用了,但是虽然它看起来确实在创建一个数据uri,但它也在为结果的开始添加一个路径 我的指南针手表也没有错误 以下是SCS: .myelement { display: block; float: right; height: 42px; text-indent: -10000px; width: 29px; background-image: inline-image('myimage.gif'); } 以下是编译后的CSS: .

我在我的项目中使用了,但是虽然它看起来确实在创建一个数据uri,但它也在为结果的开始添加一个路径

我的指南针手表也没有错误

以下是SCS:

.myelement {
    display: block;
    float: right;
    height: 42px;
    text-indent: -10000px;
    width: 29px;
    background-image: inline-image('myimage.gif');
}
以下是编译后的CSS:

.myelement {
    background-image: url("http://myproject/foo/bar/css/data:image/gif;base64,R0lGODlhDgDVAOZIAN7d3PDICPz7+eLh4O7t6/333ODf3f/+/P79+/f29Pn49/X08+no5+rp5/HLFPXcYvLOJffjgubl5PTWSPvwvPb18/788N/e3fj39fjmkfXbXPbdaPruse3s6+zr6ffhdvDJDubl4+vq6Prus/Tz8fPy8Ozr6vv6+OTj4f777vvxv/HMGfTVQvLPKPbea/zzyPXZVPDv7fnpnPfgdPfifPzzy+jn5fDJC+rp6Pz10fz0zvHKEfPSNPHw7/355fvxwuDf3uTj4vTz8vPTOfXbX/rsqPr59/343////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAEgALAAAAAAOANUAAAfygEiCgz0Kg4eHAkAMiI0dAAAJjYMnF5AhiEYkBDYDkJAoDTEVAgSfp6cGkh6opxcVgw2tkEKHCJ6oJo0GrTiIArMSiBiQDBglQQADiAsihoMLEgiT1NXW19jZ2tvc3d7f4OHi4+Tl5ufo6err7O3u7/Dx8vP09fb3+Pn6+/z9/v8AAwocSLCgwYMIEypcyLChw4cQI0qcSPGbjALXLKzQcI1GgAAvqvkA8ZEFoiMcIsCA8PEjjwcZfliI0LJmTQc1kMywWXOHikEPeAa4MeLQAZY2PzRywHMDohRCJyDK8ZGIjiJDArRARMEFxkEUJhwQFAgAOw==");
    display: block;
    float: right;
    height: 42px;
    text-indent: -10000px;
    width: 29px;
}
如您所见,正在生成数据uri,但
http://myproject/foo/bar/css/正在添加导致url无效的

My config.rb:

require "zurb-foundation"
# Require any additional compass plugins here.


# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "js"

# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
output_style = :compressed

# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
 line_comments = false


# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

非常感谢您的帮助。

您能出示指南针的config.rb吗?看起来指南针试图为你的图像添加绝对路径。尝试将此行添加到config.rb
relative_assets=true
我已经添加了我的config.rb