I tend to use XHTML due to browser compatibility. In almost all cases where I've worked with XHTML, the content has displayed in every browser the same and the times it didn't was due to certain browsers coughIEcough not supporting the CSS styles I was using.

When HTML 5 was released, I tried it and liked it however not all browsers supported everything it had to offer and some didn't handle it as expected. Over time though, this has changed. I do find that now, it is a lot easier to make a site compatible with a large range of browsers in both HTML 5 and XHTML.

The reason I ask this is because recently, while working on a website using XHTML, I came across the need to use an iframe which isn't supported in XHTML but is in HTML 5 and that got me thinking as to why I haven't changed to using HTML 5 now that it's more cross-browser compatible than it was when it was released.

Recommended Answers

All 2 Replies

there is nothing stopping from starting to develop all of your pages using the HTML5 doctype. Once you do that, its an HTML5 page. Its that simple.

Start with <!doctype html>

With that said, that doesnt mean for you to go ahead and introduce HTML5 elements. You have to do your research and figure out what the user base is going to look like (what versions of browsers), then decide on what elements are supported and how badly you want all visitors to be albe to see a consistent look, feel, and behavior.

With regards to XHTML, again, there is nothing stopping you from developing an HTML5 document with XHTML in mind. Make sure that you open and close all of your tags, use lowercase, follow strict standars, etc...

I've always made sure to use the strict standards. My site currently validates as both XHTML 1.1 and HTML 5 so switching was easy to do as it was just changing the doctype declaration. This wouldn't have worked for sites I've made previously but that's getting besides the point here.

Also, my goal wasn't to find out if I should change how I make sites. I was simply looking to find out people's reasoning for choosing one over the other.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.