the best html DOCTYPE
the best html DOCTYPE
just wondering if this is important, if it is what would by the best doctype for html or xhtml websites, or if this is alsow god for .php extensions websites?
Re: the best html DOCTYPE
Doctypes are VERY important and it depends on how you "write", read this http://www.w3schools.com/tags/tag_DOCTYPE.aspta2shop wrote:just wondering if this is important, if it is what would by the best doctype for html or xhtml websites, or if this is alsow god for .php extensions websites?
Myself, I always work with XHTML Strict because... it's strict..
Re: the best html DOCTYPE
The doctype you use should tell the browser which elements are used on that page.
The most common one would be xhtml Strict I guess
Oh and the fact that its a php page makes no difference as you are still outputting html.
The most common one would be xhtml Strict I guess
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> </body> </html>If you need to use a iframe for anything you need to use a doctype that includes the iframe element, xhtml transitional for example
<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> </body> </html>Or if you need to use something from HTML 5 like the canvas tag
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> </body> </html>so it's not really a question of which is better, you do need one if you want your page to be valid and you should use the right one for the content you have.
Oh and the fact that its a php page makes no difference as you are still outputting html.
Re: the best html DOCTYPE
ok, thanks this much more clierer now, i understand i need to use the STRIC one!
thanks guys.
thanks guys.
Re: the best html DOCTYPE
By the way, in the HTML5 structure Jacek provided you can just use this for the meta tag instead:
<meta charset="UTF-8" />
Please check out my CodeCanyon items.
Re: the best html DOCTYPE
actualy hy used:Tino wrote:By the way, in the HTML5 structure Jacek provided you can just use this for the meta tag instead:
<meta charset="UTF-8" />[/xhtml]
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Re: the best html DOCTYPE
Did not know that ! Thanks for the tipTino wrote:By the way, in the HTML5 structure Jacek provided you can just use this for the meta tag instead:
<meta charset="UTF-8" />
Re: the best html DOCTYPE
Yes, that's what he used. But what I did does the same thing but is a lot simpler and is perfectly valid in HTML5ta2shop wrote:actualy hy used:Tino wrote:By the way, in the HTML5 structure Jacek provided you can just use this for the meta tag instead:
<meta charset="UTF-8" />[/xhtml]<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
HTML5 is cool like that.
Please check out my CodeCanyon items.
Re: the best html DOCTYPE
Useful, no. But it's still kind of cool in my viewjacek wrote:I haven't really found any of its things useful yet
Please check out my CodeCanyon items.
Re: the best html DOCTYPE
Very good thread, I've been wondering the same things. Got some answers now.
Re: the best html DOCTYPE
Can we say that declaring the DOCTYPE as HTML from now on is safe?
<!doctype html>
I have been using it with my latest websites and no problem so far. I like simplicity and try to optimize the code as much as possible.
<!doctype html>
I have been using it with my latest websites and no problem so far. I like simplicity and try to optimize the code as much as possible.
Re: the best html DOCTYPE
That would be the HTML5 one...
I think it's fine to use, a lot of the big sites do anyway.
I don’t use it unless I actually need a html5 only tag though.
I think it's fine to use, a lot of the big sites do anyway.
I don’t use it unless I actually need a html5 only tag though.
Re: the best html DOCTYPE
HTML5 gives me mixed feelings. On one hand it's good to have better semantic tags instead of divs and spans for everything (even though the usage of footer and header for instance is very confusing). On the other hand HTML5 is a huge step backwards because this would be valid:
aTtRiBuTE="vAluE"I would have liked XHTML2 to be the clear winner, but unfortunately it's back to random and not so strict HTML...
Re: the best html DOCTYPE
That does not mean you can't be string on yourselflibeco wrote:I would have liked XHTML2 to be the clear winner, but unfortunately it's back to random and not so strict HTML...
Just because you can do stupid things like the one you posted does not really mean you have to.
There may be a XHTML2 after HTML5 I don't think I have been around long enough to understand the difference though.
Re: the best html DOCTYPE
I can be strict, but allowing for less strict HTML means many (newer) developers will produce sloppier code. Think of the tables of HTML4.
XHTML2 was a proposed standard, following XHTML1.1, but it was rejected because people felt it was too strict. Instead HTML5 (although from version 5 a version number will be omitted) will be the standard for the years to come.
XHTML2 was a proposed standard, following XHTML1.1, but it was rejected because people felt it was too strict. Instead HTML5 (although from version 5 a version number will be omitted) will be the standard for the years to come.
Re: the best html DOCTYPE
To escape from the sloppy and not so strict HTML4 while trying to get a more standardized web.
Re: the best html DOCTYPE
Currently HTML5 gives me mixed feelings as well, but because of a different reason. New developers who will start learning HTML5 probably won't have a clue as to what will and won't work in certain browsers, meaning they'll create partly unusable sites by using features some browsers don't even support!
Please check out my CodeCanyon items.