简体   繁体   English

样式表无法应用的可能原因?

[英]Possible reasons for stylesheets not to be applied?

We're developing this ASP.NET web app with multiple users on different browsers. 我们正在与多个用户在不同的浏览器上一起开发此ASP.NET Web应用程序。 One of the users complains that the pages look funny, and after looking at the screen shot he sent, it looks like the css is not applied. 其中一位用户抱怨页面看上去很有趣,在查看了他发送的屏幕截图后,似乎没有应用css。 According to the bug report, the user is using IE7 (but I suspect it could be IE8). 根据错误报告,用户正在使用IE7(但我怀疑它可能是IE8)。

I develop in Firefox, and using the web developer toolbar, when I choose CSS --> Disable Styles --> Linked Style Sheets, I manager to recreate a page that looks a lot like the reported one. 我在Firefox中进行开发,并使用Web开发人员工具栏,当我选择CSS->禁用样式->链接样式表时,我管理器重新创建了一个页面,该页面看起来与所报告的页面非常相似。

I sent a message in return that told him to check the options under Internet Options --> General --> Accessibility, and make sure all the check-boxes where un-chekced. 作为回应,我发送了一条消息,告诉他检查Internet选项->常规->可访问性下的选项,并确保所有复选框均未选中。 The reply was that they were, but that the page still looked funny. 答复是他们是,但页面看上去仍然很有趣。

So, the strange thing is that this app is used by hundreds of users, but I have only gotten complaints from this one user. 所以,奇怪的是,这个应用程序被数百个用户使用,但是我只是收到了这个用户的抱怨。 Does anyone have any idea of what could cause the CSS to not be applied? 有谁知道导致CSS无法应用的原因? Could it be my code, or is it some local setting in the client browser or system? 可能是我的代码,还是客户端浏览器或系统中的某些本地设置?

Could be a very mundane file-related issue - eg the version you're looking at references a file that's visible to you, but not to the user. 可能是与文件有关的非常普通的问题-例如,您正在查看的版本引用了对您可见但对用户不可见的文件。 They may even be blocking that file via browser settings, purposefully or not. 他们甚至可能有意通过浏览器设置阻止了该文件。 Have you asked them to request the stylesheet file directly and report back what they 'see'? 您是否要求他们直接请求样式表文件并报告他们“看到的”内容?

Other than that, could be issues relating to the markup used (eg bad 'type' attribute) - is your markup validating? 除此之外,可能与使用的标记有关的问题(例如,错误的“类型”属性)-您的标记是否有效?

Also, it's obvious, but have you validated your stylesheet? 另外,这很明显,但是您是否验证了样式表? Is this person the only IE7 user? 此人是唯一的IE7用户吗?

Sometimes there's no substitute for actually walking over to the user and looking at his/her setup. 有时候,没有什么可以代替实际走到用户并查看他/她的设置的。 Difficult if they're in a different location, but not impossible; 如果他们在不同的位置很难,但并非不可能; use a remote access tool like Copilot. 使用Copilot之类的远程访问工具。

If I had to guess in order of likelihood: 如果我不得不按可能性的顺序猜测:

  • They've disabled/overridden application-supplied stylesheets (enough ugly backgrounds and anyone might do this) 他们已禁用/覆盖了应用程序提供的样式表(背景丑陋,任何人都可以这样做)
  • They have a caching issue 他们有一个缓存问题

There's a few things to check. 有几件事要检查。

Firstly, check their anti-virus / security / firewall / etc. That can randomly block all sorts of things. 首先,检查其防病毒/安全性/防火墙/等。这可能会随机阻止各种事物。

Secondly, there's a registry setting somewhere to disable CSS, but that'd do it for all websites. 其次,在某处有一个注册表设置可以禁用CSS,但这将适用于所有网站。

Also, check to see if they've got a load of IE add-ons and toolbars installed. 另外,请检查是否安装了IE加载项和工具栏。 Some of them add crap to the user-agent string and it that gets too long I seem to remember IE will truncate it. 其中一些将废话添加到用户代理字符串,并且它太长了,我似乎记得IE会截断它。 This can confuse the adaptive rendering "feature" on .net 1.1 sites. 这可能会使.net 1.1站点上的自适应呈现“功能”混乱。

Oh, and make sure you've validated your CSS :) 哦,请确保您已验证CSS :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “潜在危险的Request.RawUrl”的可能原因是什么? - What are possible reasons for “Potentially dangerous Request.RawUrl”? 无法从背后的代码中看到控件的可能原因? - Possible reasons for not being able to see a control from the codebehind? 是否可以通过 ASP.NET 自定义控件 (C#) 中的 RegisterClientScriptBlock 注册 2 个样式表? - Is it possible to register 2 stylesheets via RegisterClientScriptBlock in an ASP.NET Custom Control (C#)? CSS样式表 - css stylesheets C# 错误:Microsoft Excel 无法访问文件“...”。 有几个可能的原因 - C# Error: Microsoft Excel cannot access the file '…'. There are several possible reasons 可能的原因在某些报告中,aspx Crystal Report Viewer会在IIS 7.5上无限期挂起? - Possible Reasons aspx Crystal Report Viewer would hang indefinately on IIS 7.5, under certain reports? 在ASP.NET中调试时,“ Internet Explorer无法显示网页”错误的可能原因? - Possible reasons of “Internet Explorer cannot display the webpage” error while I debug in ASP.NET? 尽管设置了滑动到期时间,但存储在ASP.NET缓存中的对象永不到期的可能原因有哪些? - What are some possible reasons for objects stored in the ASP.NET Cache never expiring, despite having a sliding expiration time set? 在MasterPage中引用样式表 - Referencing stylesheets in a MasterPage SignalR不可用的原因 - SignalR unavailable reasons
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM