网站发布时样式表不起作用 [英] style sheet doesn't work when the website is published

查看:163
本文介绍了网站发布时样式表不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
当我发布内部网站时,它看起来与在计算机上运行项目时完全不同.我的颜色和大小设置是样式表,似乎完全忽略了该样式表.

我正在使用VS2010和IE7.

有任何想法吗?

谢谢

HI!
When I publish my internal website it looks completely different from when I ran my project on my machine. My color and size settings are the style sheet and it seems like this style sheet is completely ignored.

I am using VS2010 and IE7.

Any ideas?

Thank you

推荐答案

这个想法很简单:在常规的Web浏览器中加载有问题的页面,查看其HTML源代码.它可能类似于" V iew"->. 页面S o urce".查看样式表和其他资源的URI是如何呈现的.然后使用它们以递归方式使用相同的浏览器加载所需的资源.您将看到缺少的内容.

—SA
The idea is simple: load some page in question in a regular Web browser, look at its HTML source code. It could be something like "View" -> "Page Source". Look how URIs of style sheets and other resources were rendered. Then used them to load required resources using the same browser, recursively. You will see what''s missing.

—SA


shasha_mta,

您是否尝试过使用其他网络浏览器(例如firefox或chrome)?
hi masha_mta,

have you tried it different web browsers like firefox, or chrome?


听起来像是相对路径问题.有时,在部署之后,无法正确形成被引用为图像,样式表等来源的路径.由于未下载图像或未应用样式表,因此导致在所引用的位置找不到文件.
您需要确保路径正确,以便找到并使用该文件.

我建议您使用此技巧并在设置文件源之前正确解析路径:
Sounds like it is relative path issue. At times, after deployment the path referenced as a source for images, stylesheets, etc is not correctly formed. This leads to no file found at the location referred because of which images don''t download or style-sheets does not get applied.
You would need to make sure that the path is correct such that file is found and used.

I would suggest you to use this Tip and resolve the path correctly before setting the source of the file: Resolving Paths in a Multi-Folder WebSite[^]


这篇关于网站发布时样式表不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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