To frame or not to frame

Years ago I was told not to use frames in html for some reason that I don't quite remember.  So I have avoided their use.  I would like feedback on what are the benefits and drawbacks in using frames.  Please feel free to elaborate as much as possible, and, if appropriate, provide code examples, links, etc.  Thanks in advance!  

LVL 12
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee W, MVPTechnology and Business Process AdvisorCommented:
From what I understand, way back when, it was because some browsers didn't handle them.  Today, I think you can accomplish much of what frames did using other methods - DIV for example.  The exception, I think, is using IFRAME to create a "window" frame.
The biggest reason to avoid them is because they are not search engine friendly. Therefore, you should really only use them on intranets and the like where, obviously, search engines are not a consideration.

I also personally find they are annoying to maintain.

I realise I should probably expand on this one:

Frames are very search engine unfriendly for a number of reasons.

1. They have trouble following the links in framed Web sites. Search engine robots first index a home page, and follow the links from there, encountering problems on framed sites.

2. Web directories cannot point to specific Web pages. If a search engine attempts to point at a specific page, that specific page will be linked to without companion frames (doing away with the reasons you would use frames in the first place...i.e. templating, etc.) or only link to the main framed page, without the correct subpage displayed.

Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Today, most of the reasons for not using frames are no longer valid. Let's look at them one by one:

1. When frames were first introduced, the browsers didn't all support them. In fact, a lot of browsers crashed when framed sites were opened. That hasn't been the case since version 3 browsers. So forget this one.

2. We are told that frames are not search engine friendly. By themselves, this is true. Both because there is nothing in the source code for the search engines to index, and because there are no links for the search engines to crawl in order to reach the other pages on your site. However, it is fairly simple to include a <noframes> section on your frameset site, in which you can include all those indexable keywords and links to other pages. In fact, it's almost like a free communication with the search engines. Use those heading tags and anything else to help the search engines know what's important and what's not. It's not like anyone other than the search engines will actually see this.

3. Bookmarking an internal page within a framed site will later lead only to the home page. Well, this is true for most browsers still. But the latest versions of IE will create links to an internal page in the Favorties list. Other browsers will undoubtedly follow suit soon.

4. Screen readers did not always deal well with framed sites. Not true anymore. They don't all handle them the same, but they do handle them if you set them up propertly.

5. One of the previous comments indicated that framed sites were difficult to maintain. I don't agree with this. You create one frame for your navigation, and another for content, maybe another for footer information. This eliminates the need to update multiple pages when you want to change the information common to multiple pages.

I'm not actually suggesting that everyone should use frames for all sites. They seem to be more appropriate in some situations than others. But there is really no reason not to use them anymore.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I realise I'm not adding much to what has been said, but just adding my 2 Euro cents.

These days I don't think twice about delivering a site's content through an IFRAME.  I don't see this as a search-engine handicap, because my index page (in which the IFRAME is embedded) contains all my site navigation anyway.  That's the point of it in my view: individual sub-pages contain only data, and I don't have to replicate the navigation over every single page.  I'd also tentatively suggest that it's truer to the spirit of 'the semantic Web'; the same reason global CSS schemes are encouraged.  Eliminating redundancy and reducing disk and bandwidth overhead are the added bonus.

Cross-document linking isn't affected at all by using frames.  The view is often taken that not having the whole site's nav links on every page harms the internal link-relevance (right terminology?) of the site; I disagree strongly with this. In fact, relevance is arguably improved by a document only containing links to other pages (in the same site or otherwise) for a specific reason of related content, beyond that of just being part of the same site.

And if Google don't like it, then they blimming well should.  you can pry my IFRAMES from my cold dead hand.
PreeceAuthor Commented:
Thanks! I'm really liking the feedback so far.  So I've upped the points.  I'm going to let the question simmer for a few more days, then award points.  

Thanks again everyone!

Just a note on iframes. Prior to version 6, Netscape browsers did not support them. So, if your audience includes people who might be using older Netscape browsers, you should avoid them. Frames themselves are supported by both IE and Netscape browsers, versions 3 and up.

And as far as the search engines go, the iframes have the same issues as the regular frames. The search engines can't see the content inside them. But regular framesets allow you to build a <noframes> section, where you can place indexable keywords for the search engines. Iframes don't offer that option. Remember, search engines don't just look at links on the page. They are looking for content. Most of today's search engines ignore those keywords meta tags that framesets sometimes rely on. You do have to put content on the page so the search engine knows what your site is about.

I like iframes in areas where I want to put a lot of text and I don't have a lot of room for it on the page. It's nice to be able to create a scrolling text area for content.


the above are three links to articles discussing this topic.

I personally am not a fan of using frames.  Personally, I would much rather create a site using divs/css.  In order to keep my navigation easy to place on any page, I simply use an include file to place my navigation where I want it (and I dont have to see the code on every page I make).  

My main drawback to frames is that most readers dont like them (see the first article I posted for stats).  Frames can be ugly, cumbersome, and a majority of viewers find them annoying to a degree.  I would much rather design something with divs/css than resort to frames.
I realise there are drawbacks (not trivial) mentioned in these articles, but as was pointed out in the first one, a good overall design can compensate for these.  Sometimes they are well worth it, I feel.

The people I've made sites for are on a zero-budget, and don't have the luxury of server-side anything, hence the value of navigation code in a common page.  Updates would not be affordable for them on a page-at-a-time basis.  It's one of the occasions where, realistically, one must defer to a not-ideal solution in order to cater for the majority of users.

Provided I use a robots.txt that instructs full indexing, all my content will be indexed through the index page's nav links.  Some of my content-pages have their own menu-hierarchies, and guess what? Those got indexed too! Any of those pages can be enjoyed in their own right, *if* the user doesn't have JavaScript.  If they do, they'll get the page redirected to within my index page, as it was intended to be viewed.  For the no-framers, each page has a link to the lo-fi index page.

I'm sorry, but what is being said here about search engines is not borne out in my experience (albeit not so lengthy).  And I think the very existence of search engines and the indexing they perform is the most palpable reason why pages - standalone documents in their own right - should not have to have the whole site's hierarchy mapped out in their own structure.  If you are interested in the parent site, fair enough, but when you look at Joe Blow's homepage on Geocities it shouldn't be necessary to have a hot-link to Yahoo Local's current listings for pipe-fitters in the downtown Seoul area. RELEVANCE, dammit!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.