【发布时间】:2014-08-16 09:56:39
【问题描述】:
我有一个单页 MVC Web 应用程序。当发生服务器错误时,我们会在同一页面的对话框中显示异常。 ASP.NET YSOD 添加了内联 CSS。由于添加到 BODY 元素的样式,这会更改整个应用的字体。
有没有办法将添加的 CSS 划分到该对话框中?还是在对话框关闭时删除了添加的 CSS 样式?或者编辑样式和错误页面,使样式不是全局的?
这是添加的内联 CSS:
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
【问题讨论】:
-
你能编辑添加的css吗?如果是这样,它可以很简单。否则,您可能必须放置
<iframe>以隔离 css。
标签: css asp.net asp.net-mvc