Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.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
Twitter bootstrap 3 Bootstrap 3图标样式中的相对路径问题_Twitter Bootstrap 3_Glyphicons - Fatal编程技术网

Twitter bootstrap 3 Bootstrap 3图标样式中的相对路径问题

Twitter bootstrap 3 Bootstrap 3图标样式中的相对路径问题,twitter-bootstrap-3,glyphicons,Twitter Bootstrap 3,Glyphicons,请参考图片。在index1.html和index2.html中一切正常。但Glyphicon在index2.html中不可见,但在index1.html中,当从子目录引用根目录中的其他文件时,它可以正常工作。请尝试使用..,因为这将为您设置1个目录 或者在文件引用之前使用/,它将假定您从根目录开始文件路径 实例 ../../../myfile.css-备份三个目录 /tree1/tree2/tree3/myfile.css-从根目录中放入三个文件夹,以查找相应的文件以供参考 index2.htm

请参考图片。在index1.html和index2.html中一切正常。但Glyphicon在index2.html中不可见,但在index1.html中,当从子目录引用根目录中的其他文件时,它可以正常工作。请尝试使用..,因为这将为您设置1个目录

或者在文件引用之前使用/,它将假定您从根目录开始文件路径

实例 ../../../myfile.css-备份三个目录

/tree1/tree2/tree3/myfile.css-从根目录中放入三个文件夹,以查找相应的文件以供参考

index2.html中包含的glyphs引用将是

../fonts/glyphicons-halflings-regular.ttf 或
/glyphicons半身人常规。ttf

您在控制台中遇到404个错误吗?正如Lekhnath所说,检查控制台,看看它是否能找到glyphicon字体。您需要从根目录中包含它,即/font/glyphicons。。。而不是../font/glyph图标。。。为了在不同的目录级别工作,我在控制台中没有收到404错误。刚才我注意到它在除Mozilla Firefox之外的所有浏览器中都能工作