I'm having a problem with the way a page is being rendered in IE7 (of course) and I decided to run the page source through the W3C validation tool.
I fixed all of the errors and warnings listed for the page (which isn't easy when your page's content is generated by ASP.NET) . This didn't fix the problem in IE7.
The doctype that ASP.NET uses by default is:
I decided to switch the doctype to:
I ran the page with the new doctype through the W3C validation tool and found a bunch of new errors.
One of the errors is:
enabling start-tag requires SHORTTAG YES
I was under the impression (maybe I learned this when I learned about XML) that you should always close your element tags...and if they are empty you can just use "/>" to end it.
For example:
<br />
Apparently this is not the case with HTML...
My findings online are that you should use XHTML if you want to use "shorttags" . I didn't think that IE supported XHTML....
So why would ASP.NET generate HTML that uses short tags?
Oh never mind that question (stupid MS)
How do I turn on "shorttags" ?
Thanks
-Frinny
I fixed all of the errors and warnings listed for the page (which isn't easy when your page's content is generated by ASP.NET) . This didn't fix the problem in IE7.
The doctype that ASP.NET uses by default is:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I decided to switch the doctype to:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
I ran the page with the new doctype through the W3C validation tool and found a bunch of new errors.
One of the errors is:
enabling start-tag requires SHORTTAG YES
I was under the impression (maybe I learned this when I learned about XML) that you should always close your element tags...and if they are empty you can just use "/>" to end it.
For example:
<br />
Apparently this is not the case with HTML...
My findings online are that you should use XHTML if you want to use "shorttags" . I didn't think that IE supported XHTML....
So why would ASP.NET generate HTML that uses short tags?
Oh never mind that question (stupid MS)
How do I turn on "shorttags" ?
Thanks
-Frinny
Comment