Your Iframes are Bad

It's time to come face to face with the facts- your iframes are not a good thing for your website. In the past, I've encouraged the use of frames almost obsessively, and now it's time for me to say something I should have said a long time ago- I was wrong. Iframes are not the savior of our websites. They're an outdated trend and a nuisance, and deserve to be buried deep within the recesses of the internet, along with celebrity layouts. But that's another story. By now you're probably wondering why on earth you should convert from iframes, when it's all you've ever used. Well...

First Of All, Why Do You Use Iframes?

I would imagine it's for the convenience of it, isn't it? With iframes, supposedly you can save yourself a ton of time by only having to change the frame page when you change a layout. To some extent, I suppose, you're right. To change the actual layout of a website, you only have to change one page. But what about the framed pages? They won't match any more. Unless you're using an external stylesheet (which you should be, regardless- just saying), you'll still have to go through your pages individually and copy-and-paste your stylesheet. Doesn't that defeat the purpose?

Now, Let's Talk About Aesthetics

Do you really think that frame of yours looks good on your website? Think about it. On some pages, it might not be noticeable. But on others, they are painfully obvious. There is a giant scrollbar coming down the side of your content area (unless you've changed the default settings of your website's scrollbar with invalid CSS- you didn't do that, did you? Please say you didn't...). That scrollbar might cover up your content, or it might squish your content together a little bit too much for comfort.

Even if the page you are currently browsing isn't one that is big enough to need a scrollbar, there are other issues. Look down, for instance. Odds are that there is quite a bit of empty, unused space towards the bottom of your page. Is this attractive? No, it isn't- and it's awfully tedious for a user to have to scroll that much to get to your website's footer (if you have one).

What About the Convenience of the Visitor?

If you want to have a successful website, no matter WHAT kind of website you own, you want to cater to you visitor- bottom line, period. I don't know of a single website owner that doesn't love to get hits or comments on their blog. Iframes are a nuisance to visitors- they annoy people, and for several very important and valid reasons.

If you're using an iframe, chances are you've set it to a ridiculously high pixel height (say 15,000 or so) in order to avoid the hideous aforementioned scrollbars. Did you know that this can cause problems with your visitors' browsers? I bet it never even crossed your mind- I know that when I was using frames, I didn't give that sort of thing a single thought. But it's true- ridiculously high amounts of scrolling can cause people's browsers to lock up and freeze, or slow down dramatically. I encounter websites with these problems all the time, and rather than wait for my computer to unlock, I just click out of the website as soon as I can. The last thing you want your visitors to do is go away without even waiting for a page to load, so don't lock up their browsers with huge frames!

Another inconvenience of iframes is the scrolling itself. It can be very difficult and obnoxious to have to scroll through both a site's main layout (if your layout is so big as to need a scrollbar, which it probably does- especially on smaller screen resolutions like 800x600) and the iframe. I find this annoying, and, personally, if the website hasn't already impressed me, I'm likely to give up. Yes, I give up a lot and am a lazy visitor, but how can you know that your own visitors won't be just as lazy?

Iframes also provide issues for your visitors as they go to bookmark or link to pages. They can't access the framed pages to link them directly- only the outside frame. What if they want to link to a specific article or graphic on their website? They'll have to link to your main page, then provide instructions for finding the article or graphic and hope that their visitors will be properly directed. Not only is this an inconvenience for your current visitor, but it's an inconvenience for any new traffic you might get from that link as well. This lack of individual page identities is also a problem for page refreshing and moving back and forward, and it comes into play in other ways as well.

What's my point with this one? Iframes are an annoyance to your visitors, and, whether you know it or not, they might be losing you returning traffic or new hits. Do you really need another reason to convert?

Google Doesn't Like your Iframes, Either

Over time, Google can gain you a lot of extra hits. They do this by matching your website up with relevant terms, and they can rank your pages by usefulness to a searcher. They can turn up your articles on separate pages by relevance to the search, and your articles can bring in new readers to your blog as well. Bad news, though. Guess what?

If your pages are in an iframe, Google won't accept them. It won't include them as a part of your website, and it can't look through them easily at all. All Google can see if it looks at your website is the frame page. Odds are that the frame doesn't have much content at all, and Google will recognize this. It can hurt the ranking of your pages in a Google search, turning away more traffic for your website.

If by some miracle an article of yours in a frame turns up in a Google search, a potential visitor would click on it, read the article... then nothing. Without the frame page, they can't see the rest of your website, or the navigation to find the rest of your website. How are they supposed to know there's more? True, you say, you can use the URL in the address bar to find your home page, but how is the average browser supposed to know that? Do you think they will? Odds are that they won't. If they DO try something like that, however, they might not even know the page as belonging to the same website! Your framed pages look completely different from the frame page- how is a visitor supposed to know that they're the same website?

But I Need My Iframe!

Obviously, iframes are bad, and they belong in the past. You may still hesitate to bring about the end of your frame era, however, because the convenience they offer you just doesn't seem to be had any other way. Wrong again. There is always a better way than iframes. After all, you don't see huge corporate websites with iframes, do you? But do you think they go through and update every single page every time they have a layout switch? Of course not, silly.

If your host supports PHP, try using PHP includes. However, not all free hosts support PHP, and, while I'd recommend moving to a host that does, you can achieve what is essentially the same effect by using regular Server Side Includes. Freewebs even supports these, so now you've got no excuse! If you plan on using the same DIV names for every layout, and don't plan on changing your navigation much, you can even utilize external stylesheets to get the same effect. It really doesn't matter which you use. All of these fix every single issue with frames that were covered in this article! All that matters is that you convert as soon as you can, and for the love of whatever-it-is-that-you-value, spread the word about the problems with iframes.