WTF is XHTML?
One of my favorite newspaper comic strips, old as it is now, is a work by the name of “Bloom County,” written by a man named Berkley Breathed, and famous for its loveable protagonist “Opus” the penguin. In one strip, the liberal-minded character Binkley was sent off to pick up ice cream for the crew – but returned instead with frozen tofu, touting its superiority to ice cream. In the final panel of the strip, that character was wearing a frozen tofu cone on his head (his friends obviously wanted ice cream!) and muttering how “kicking and screaming” the ignorant would be “dragged” into the future.Well, if you don’t know what XHTML is, but you’re in the adult Internet business, then it might be time to let yourself be dragged kicking and screaming into at least the present … if not the future. And don’t worry; XHTML is better than a frozen tofu cone.
I’m assuming here that you’ve at least heard of HTML, or HyperText Markup Language – the original language of the World Wide Web. Many adult webmasters who got their start years ago are rather familiar with HTML code at this point. Others use programs like Adobe’s Dreamweaver to make their Web pages, letting the software design the code, and seldom look under the hood at the code itself – not a good habit for webmasters who take their craft seriously. It always pays to have a good understanding of HTML code, which can come in handy when trying to figure out why a page you designed isn’t displaying exactly right in your browser window. Knowing HTML is also vital when you integrate scripts into your website – especially when the scripts require templates in order to work properly.
Now before we get to XHTML, a quick history lesson. Most website designers are aware that different browsers can sometimes yield different results when viewing the same page. Just because your page looks good in Internet Explorer, for example, doesn’t mean it will display how you intended in Firefox, Opera or Safari. A lack of standards and universality led to the creation of the World Wide Web Consortium, often called W3C for short. It was founded in 1994 after Web creator Tim Berners-Lee left CERN; the primary purpose of W3C was to encourage Web standards. Rather than having companies like Microsoft, Apple and Mozilla all out there doing their own things, W3C published official standards for website design that, when adopted by browser makers and website designers, help achieve better universality.
Early moves by W3C were relatively mild – until HTML 4 pushed CSS, or Cascading Style Sheets. Prior to CSS, the instructions for the formatting of content on a Web page, such as text appearance, were generally done in each page itself, which proves convenient for the designer but not very flexible in the big picture of Web design.
Let’s say you have a certain text display style that you want to stay consistent all throughout your site – maybe you want the color of all unlinked text to be green, for example, to match your company’s logo. Now let’s say your company changes its logo to blue, and you need to update the entire site with blue text instead of green. With proper use of CSS, changing the text color throughout the entire site (no matter how many pages use that text style) would mean changing only one file, and likely only one entry in that file.
The emphasis on CSS, and other changes to the HTML standard, improved universality; but even with HTML 4, the situation was still far from ideal. W3C eventually decided that HTML just wasn’t a stable enough answer for the evolving World Wide Web, and their solution was the Extensible Markup Language (XML).
When first glancing at XML, it doesn’t look that different from HTML. XML code contains things you’d expect, like tags and attributes – but it’s far more flexible and powerful because it lets you design your own markup language. Rather than using tags that are always the same, you define your tags and their relationship to data. When you’re using XML, you can use tags that are highly descriptive to your website’s unique content. And once you label data, it’s easier to use that data in different ways.
Introducing a new language for webpage design is one thing, but that doesn’t mean designers are going to accept that new language – in fact, you might just get a tofu cone shoved on top of your head. Coders are notoriously lazy, and it can be hard to convince old dogs to stay up on their technology tricks. W3C might see big picture problems with HTML, but for a lot of website designers, the problems weren’t big enough to go back to the drawing board themselves. Plus, XML is a little less forgiving than HTML – you have to pay more careful attention to syntax.
So how come if XML has been around for some time now, you’re still coding your website in HTML? Probably because you’re lazy. Your friends at W3C, in an attempt to woo your lazy ass over to the more powerful XML, made the clever decision to rewrite HTML in XML – and the result was XHTML. This solution let lazy coders continue to use the code that’s familiar; but it also adds the power and flexibility of XML.
If you’re interested in learning XHTML, you’ll be happy to know that you can get started simply by learning a few simply syntax and formatting rules. Start by looking over these syntax rules linked below, and then trying to incorporate them into your next page design.
http://www.w3schools.com/Xhtml/xhtml_syntax.asp
Later on, we’ll look at some of the cooler things you can do with XHTML that simply can’t be done with HTML.