chavista — 2013-06-23T12:22:49-04:00 — #1
I'm thinking of converting my websites to HTML5 and wanted to solicit some advice. There's tons of information online, but I haven't yet answered some basic questions.
A little background: I was quick to adopt XHTML when I first started learning about web design several years ago. However, I discovered that many pros were still sticking with HTML. Eventually, I realized that XHTML wasn't worth the trouble, so I switched back to HTML. The main thing I remember is all the time I spent converting my closing tabs - adding the backward slash to breaks and images, for example.
I assume there are regular expressions that can convert image tags in text files, but what about content stored in databases? Is there some sort of regex search and replace function I can use on database tables?
If I switch to HTML5, what tags would I have to convert besides images? It looks like break tags don't need the backwards slash.
Are there any other things I should be aware of before I take the plunge? It sounds like once I switch, HTML5 might actually be a little easier to work with. I certainly like the new doctype.
Thanks for any tips.
stevie_d — 2013-06-23T13:47:40-04:00 — #2
One of the overarching principles behind HTML5 was that it should not break anything that was legitimate HTML4, although there were a handful of particularly obscure tags that I think are being excluded from the specification. So if your site validates as HTML4 then it should continue to validate as HTML5. What you have is a load of extra tags, which you can incorporate into your design templates and forms as and when you wish.
I know there are people out there who have adopted the HTML5 doctype but haven't changed anything else in their markup at all!
chavista — 2013-06-23T14:12:00-04:00 — #3
So if I don't change all my image tags, they'll still work fine? Wow, I think I'm sold! Thanks for the tip.
felgall — 2013-06-23T15:44:08-04:00 — #4
By the time (X)HTML5 actually becomes a standard the last of the browsers to not support XHTML (IE8) will hopefully be dead and you might find that a lot of the pros who have been waiting for XHTML to start working might switch to using XHTML5 instead of HTML5.
Certainly all of the browsers that support HTML5 fully will also fully support XHTML5.
ioan — 2013-06-25T11:48:05-04:00 — #5
You can safely switch all of your xHTML work to HTML5, it is supported in all browsers. You can even get support with IE6,7,8 but for that you would need to use https://code.google.com/p/html5shiv/ , or just use Modernizr which can add that for you. It's really easy to use and it is a good change. I've been working as a PSD to HTML person for around 4 years and i was reluctant to change, i just did it last summer when at least 60% of jobs required HTML5. It's a really easy transition coming over from xHTML 1.0 strict to HTML5. You can basically use everything that you have and just change the doctype, but HTML5 is incredibly semantic and I would really recommend taking advantage of all of it's new tags. Cheers!
felgall — 2013-06-25T15:27:26-04:00 — #6
You can safely switch all of your XHTML work to XHTML5, it is supported in all modern browsers - it is only IE8 and earlier that don't support XHTML.
Note that with XHTML5 you don't need a doctype at all as quirks mode only exists with HTML - XHTML only has standards mode.
Using PHP I'd use the following as a starting point for XHTML5 pages (you need the content header set using a server side language unless you have your server set up to default to XHTML instead of HTML):
header("Content-Type: application/xhtml+xml; charset=utf-8");
echo '<'.'?xml version="1.0" encoding="UTF-8"?','>';
<title>An XHTML 5 Template</title>
<link rel="stylesheet" href="css/main.css"/>