<DOCtype > is changing to quirks - html

I have defined the <DOCTYPE> in jsp page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
but when opening the page in IE8 it's getting changed to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
which is causing menus issue, hover is not working.
Could you tell em why <DOCTYPE> is getting changed.

Related

background position in mozila and ie

I have this css
.viewimages{position: fixed;}
which works in chrome and Mozilla but the position isn't picking in i.e instead it is floating left yet it is suppose to position itself in the center.So any help
This should be fixed by adding a doctype to the top of your HTML document, forcing the browser to be a bit more standards compliant:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Or if you're using XHTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
This will work unless you are relying on quirks mode to render the page then unfortunately there's no support.

Razor View - Extra line at top of 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>
Is rendered as:
--- empty line ---
<!DOCTYPE etc...
My understanding is that this additional line can cause issues with elder versions of IE, forcing the browser into quirks mode.
This can be resolved, by putting the Layout deceleration and doctype on the same line, but that's a bit, well ugly. (although not as ugly as the transitional doctype, that was never a thing of beauty!)
You could always invert the order in which those directives are appearing:
<!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>

Doctype issue for active link

The CSS active link property is not working in ASP.net.
When i comment the Doctype, it starts working fine. Following is the Doctype:
<DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I found many doctypes but the other CSS stops working when I change.
Is there any way to use active link property with this doctype?
This is the HTML and CSS code
<DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
a:active
{
background-color:Red;
}
</style>
</head>
<body>
w3schools.com
wikipedia.org
</body>
</html>
I would recommend using the HTML 5 doctype, <!doctype html>.
If you choose to stick with the one you're currently using, do it this way:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Please notice the ! at the beginning. You need those. :)

How do I use a DOCTYPE that validate?

I am trying to troubleshoot some issues on a website that is going live today and I keep getting this funny error in Firebug and on the W3C validation site
Here is my DOCTYPE code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Here is the error I get:
syntax error
[Break On This Error] < !DOCTYPE html PUBLIC "-//W3C//DTD XHT.../xhtml1/DTD/xhtml1-transitional.dtd">
Any guidance on this seemingly simple task would be appreciated.
Thanks.
Seems you have the same problem here:
http://blog.ryanrampersad.com/2008/09/06/syntax-error-break-on-this-error-doctype-html-public-w3cdtd-xhtml3orgtr-xhtml1-dtd-xhtml1-strictdtd/
check your script tags!
the following gives the same result:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src=""></script>
</head>
<body>
</body>
</html>

validate html, problem in my doctype and use of lan(g)

I can't get my website validated; it jumps an error on my doctype which is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//ES" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
(under Spanish)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
(under English)...
The html tag:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lan="en">
THE ERROR
Error: unrecognized DOCTYPE; unable to check document
any idea why?
do not specify the language in the doctype but always use:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" .......
Set the language in the <html> tag: <html lang="es">
http://www.w3.org/QA/2002/04/valid-dtd-list.html#DTD
http://www.alistapart.com/articles/doctype/
I use this one, which is the same, except for the html in lowercase. I'm not sure if that would matter.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Dit you check if there's any whitespace before the doctype?
The upper/lower case issue of "html" is described here: Recommended Doctype Declarations