Razor View - an additional line at the top of the template

@inherits VooDooBytes.Site
@{
Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

Displayed as:

--- empty line ---
<!DOCTYPE etc...

I understand that this extra line can cause problems with older versions of IE, forcing the browser to work in quirks mode.

This can be resolved by putting layout slowdown and doctype on the same line, but it's a bit, but ugly. (though not as ugly as the transitional type, which was never perfect!)

0
source share
1 answer

You can always invert the order in which these directives appear:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@inherits VooDooBytes.Site
@{ Layout = null; }
<html>
+1
source

All Articles