I have a single-page MVC web app. When a server error occurs, we display the exception in a dialog in the same page. The ASP.NET YSOD adds inline CSS. This changes the fonts for the whole app because of the styles added to the BODY
element.
Is there a way to compartmentalize the added CSS to just that dialog? Or have the added CSS styles removed when the dialog is closed? Or edit the styles and error page so the styles are not global?
This is the inline CSS that is added:
<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>
<iframe>
in order to isolate the css. – tweray Jun 25 at 18:25