Forum Moderators: open
So you can just use <!DOCTYPE html> instead, if you want your pages to validate, but it will have no effect whatsover on what features actually work in the browser :)
XHTML is dead as a dodo and has been for years.And, again, I will educate you that you are flat out wrong.
the doctype declaration is a legacy from the SGML days, its only function is to switch browsers into standards-mode for CSS layout features.This statement is also false. The doctype, as used on HTML web pages, was created for IE only due to its lack of proper standards support though its roots are in the SGML doctype declarations. It in no way resembles what SGML did/does. Nor is intended for CSS usage.
The doctype you use has no effect on HTML elements supported in the browser. Browsers just ignore it and use the same HTML5 parser they use for all HTML pages.Ignoring the fact that they go into quirks mode without one and you never want to be in quirks.
the doctype declaration is a legacy from the SGML days, its only function is to switch browsers into standards-mode for CSS layout features.
The doctype you use has no effect on HTML elements supported in the browser. Browsers just ignore it and use the same HTML5 parser they use for all HTML pages.
So you can just use <!DOCTYPE html> instead, if you want your pages to validate, but it will have no effect whatsover on what features actually work in the browser
<!DOCTYPE html>
<!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">
is a promise to adhere to the mentioned DTD, you should not use anything specific to html5.
the doctype declaration is a legacy from the SGML days, its only function is to switch browsers into standards-mode for CSS layout features.This statement is also false. The doctype, as used on HTML web pages, was created for IE only due to its lack of proper standards support though its roots are in the SGML doctype declarations. It in no way resembles what SGML did/does. Nor is intended for CSS usage.
The doctype you use has no effect on HTML elements supported in the browser. Browsers just ignore it and use the same HTML5 parser they use for all HTML pages.Ignoring the fact that they go into quirks mode without one and you never want to be in quirks.
gouri wrote:
If I use
<!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">
does this mean that I shouldn't use HTML5 or I can't use HTML5?
When you say convert the template to HTML5, do you mean changing the DOCTYPE from what it is to <!DOCTYPE html>
If you mean changing the DOCTYPE, would I be able to do that or do I have to go with what the DOCTYPE of the template is?
<!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"> <!DOCTYPE html><html> I cannot make changes in the head section of a page and I think that this is where the DOCTYPE declaration is made, so I am not sure that I would be able to change the DOCTYPE. Am I right about this or would I be able to change the DOCTYPE?
I cannot make changes in the head section of a page and I think that this is where the DOCTYPE declaration is made, so I am not sure that I would be able to change the DOCTYPE. Am I right about this or would I be able to change the DOCTYPE?
Technically, if you're in control of the server presenting the template, you can, but it's a bit cumbersome and definitely a work-around if you don't have complete control over the template coding, because in that situation the change would have to be "server-side script" [eg PHP] based.
I don't understand your situation. Do you mean that you can't upload your own pages to the server?
If it is shared hosting, can I change the DOCTYPE?
I don't think that I can upload pages to the server. I think that they have to be created in the hosting account.
Lucy wrote:
The two "html" are unrelated things. The first is part of the doctype. The second is part of the wrapper for the entire page: <html> at the very beginning, </html> at the very end.
Also, When you said you're using a template, do you mean a CMS?
I read that even if there is one tag that is used that is not part of a certain DTD, the browser goes into quirks mode.
An example would be having XHTML as your DTD and using <br> instead of <br />. <br />, I believe, is what should be used with XHTML.If you aren't serving your page as application/xml+xhtml, then you are serving broken HTML and browsers will treat it as such. And I almost guarantee you are not serving XHTML but "tag soup".
However, we already know IE<9 doesn't know what the new elements are and won't let you style them
Can I style the tags inside the tags that IE<9 does not recognize and have the content appear the way that I have styled them? For example, if a have an <h2> tag and a couple of <p> tags inside a <section> tag (which IE<9, I believe, would not recognize), can I style the <h2> tag and the <p> tags and the content in those tags will appear the way that I styled them even though all of that would be in a <section> tag?
section h2 {color: blue;} section {background-color: #EEE; padding: 1em;} .blue {color: blue;} <section class = "blue">
<p>blahblah</p>
</section>
<section>
<h2 class = "blue">Blahblah</h2>
</section> For example, if a have an <h2> tag and a couple of <p> tags inside a <section> tag (which IE<9, I believe, would not recognize), can I style the <h2> tag and the <p> tags and the content in those tags will appear the way that I styled them even though all of that would be in a <section> tag?