Internet Explorer

Problems with attributes not working in IE and Opera?August 30th, 2010

So, what did I do with my bank holiday weekend? I was intrigued by some odd Opera and IE behaviour — that’s what

I was presented with a site whose styling wasn’t working for certain tags. It was an odd one. I thought it might be an absolute positioning bug, but testing was bringing up nothing – why on earth would simple CSS styling, nothing special, fail completely in Opera?

Then I took a closer look at the source — and something caught my eye. There was some malformed HTML:
<h1 title="test""style="background-color: #ccc">Test</h1>

Gotcha! Removing that innocent looking multiple quote fixed the problem. But I still wasn’t happy. Browsers should recognise and fix badly formed HTML, no? It’s not like a closing tag was completely missing. So I made a basic HTML template with little more than the h1 tag you see above, and just enough HTML5 to make it validate.

Then I played around with it. What happens if I add a space?
<h1 title="test"" style="background-color: #ccc">Test</h1>

That fixed it. Hm. Why on earth would the lack of space break things? Lacking a space is completely fine in both HTML and XHTML. Let’s remove the space again, and test some more. What if I replace the rogue ” with another character – say $?
<h1 title="test"$style="background-color: #ccc">Test</h1>

Wait — that’s a turnout for the books — it now breaks in Chrome. Then it dawned on me. If I replace that dollar sign with a normal alphanumeric character — the character ‘a’:
<h1 title="test"astyle="background-color: #ccc">Test</h1>

That’s it! Without the space between attributes, Opera and Internet Explorer are treating “style as the attribute, with Webkit and Gecko being smart and removing the extra quote. Add the space, and Webkit does the same. Obvious when you think about it, isn’t it?

So that’s what I did with my bank holiday weekend. What did you do?

Web browsers: a rundownNovember 28th, 2008

With Google entering the web browser market, there’s now more choice for the user than ever before. But most users don’t even realise such a choice exists, and stay with the default choice in their operating system (Internet Explorer). So here’s a rundown of the most popular browsers out there, and what’s so good — and bad — about them.

Internet Explorer 6

This is what you’ll get by default if you have Windows XP. Now eight years old, IE6 is one of the oldest browsers out there. It doesn’t follow standards properly (and doesn’t follow the very latest standards at all) and has many security problems. All IE6 users are urged to upgrade to IE7.

Internet Explorer 7

IE7 comes with Windows Vista, and is the current version of the Microsoft browser. Improvements over IE6 include tab support, better font display, and better security. Although not as good as other browsers, IE7 also supports standards better than IE6.

Internet Explorer 8

Not yet released (it’s in the late stages of public beta), but Internet Explorer 8 is the upcoming version, with a release planned vaguely soon. I’ve been playing around with it this week and I’m very impressed. Improved features include a better address bar, better search bar, and improved crash recovery (so improved, in fact, you barely notice anything’s crashed)

Firefox

The most popular Internet Explorer alternative. Firefox is an open source browser, which means that it’s free to download and use, anyone can contribute to the code, and anybody can create a plugin for the browser.

Safari

Safari is to Mac OS what Internet Explorer is to Windows. That is, it is the default browser for Macs. Built on the very standards-compliant Webkit engine, it’s very quick and very good looking. Safari is now actually available for Windows, but I agree with those who say that it looks slightly out of place: it has the look and feel of a Mac OS application but inside the Windows look and feel operating system, so it does take a little getting used to.

Safari is also the browser included in the iPhone, which means you get the real web, and not a stripped down WAP-enabled where-the-hell-did-all-the-pictures go web.

Opera

Not many people will have heard of Opera, and to be honest, nowadays it’s nothing to phone home about either. Just like Safari, Opera is available for mobile devices, but other than that it’s pretty much “just another browser”.

Google Chrome

The latest entrant to the sardine can known as the web browser market. Chrome uses the same engine as Safari (Webkit) behind the scenes, but with a lot of improvements that many current browsers don’t yet have. These improvements include running tabs as different “processes” which effectively means you have more than one version of chrome running (so it’s better when it crashes), a better address bar which includes suggested search results and previously visited sites, and a default homepage which contains your most visited site.

Chrome is still very new to the market and has little market penetration (current figures range from 1-5%), but some commentators believe that Chrome will eventually do well.

Which one to choose

So, the question to ask now is which one to choose. Well, personally I say nowadays you can’t go very wrong. With the release of IE7, all browsers are at least vaguely standards compliant (which is the main thing) and most browsers are now decent bits of software.

This renewed competition has been a very good thing in recent years, with many developments being made. All of the browsers now have their pros (and, of course, their cons), so my advice to anybody is to try out all the different browsers for a bit and see which one suits you the best. Afterall, there’s no harm in it.