为什么CSS样式未应用于子目录内的网页? [英] Why the CSS style is not applied in webpages within subdirectories?
问题描述
在我域的根目录中,我有CSS文件 style.css
和母版页文件 site.master
.
In the root of my domain i have the CSS file style.css
and the masterpage file site.master
.
site.master中指向CSS文件的链接是
The link to the CSS file within the site.master is
< link href ="style.css" rel ="stylesheet" type ="text/css" media ="screen"/>
问题在于子目录中包含的网页无法继承CSS文件.
The problem is that webpages contained within subdirectories do not inherit the CSS file.
我在这里做错什么了?
如果我将 style.css
文件复制到子目录中,则所有内容都像一个超级按钮...
If i copy the style.css
file to the subdirectories everything works like a charm...
更新:如果我将路径更改为/style.css
或〜/style.css
,则该样式也不适用于根文件夹中的网页.
UPDATE: If i change the path to /style.css
or to ~/style.css
the style is Not applied also to the webpages within the root folder.
推荐答案
您需要将路径指定为/style.css
.
这篇关于为什么CSS样式未应用于子目录内的网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!