When should I use HTML frames?
(1) Not inherently. iframes have many use cases that do not suffer from the problems of frames. They're useful any time you want to mix in a document from another security context, or without the scripting and styles that the parent page is using.
However, it is possible to ‘use an iframe like a frame’: to split the page up into separate iframe areas, with cross-frame-links making a navigational mess that doesn't play well with bookmarks, open-in-new-tab etc.
(2) I would not use frames for anything today. There was a limited use case for them keeping hold of large amounts of page content that you don't want to reload on each navigation. But these days we would just use XMLHttpRequest
to update part of the page instead.
Even so, without care taken to make page-changing links accessible (using hash-history and having a static-link analogue for each hash-link, linked with real <a>
s that response to middle-click et al), a page that updates/navigates itself using XMLHttpRequest
will recreate many of the navigational problems of frames, with strongly negative usability, accessibility and SEO implications.
I find it a bit sad that many authors are creating flashy, swooshy, “modern” animated web sites that, by naïvely using jQuery's load()
or similar on its own, exhibit all the worst behaviours of ancient, hated frames.
Why are HTML frames bad?
Frames are more difficult to bookmark and, therefore, more difficult to share with others.
http://www.yourhtmlsource.com/frames/goodorbad.html
Why are frames deprecated in html?
Jakob Nielsen wrote a 1996 column that criticized frames. Some key points:
Frames prevent users from properly bookmarking pages. When a bookmarked frameset page is loaded, users' previous mouse clicks inside the frames do not matter. Only the outer URL is saved, and users have to navigate to where they were manually.
Frames present challenges for printing web pages. Printing all the frames at once is not suited to the different dimensions of paper (and users can get only the first pageful that way). Users generally have to right-click the frame they want and choose the appropriate context menu option.
Users coming from search engines may not have access to navigational elements if they are located in another frame — they are directed to only that frame the search engine found the text in.
While "framesets" (the most common type used on late 1990s/early 2000s web pages) are dying, the iframe (short for inline frame) remains alive and well. In fact, recently iframes have been found useful in today's "mashup" web applications, and extensions to the iframe are currently proposed in the HTML5 specification.
For example, Facebook, in its API for app developers, uses them to seamlessly integrate third-party apps with their own site while minimizing the security risk. (In this model, all third-party code remains on a separate domain, which is good for security reasons.)
What's wrong with this frames?
As already mentioned in the comments, it is preferable to avoid using frames.
But in answer your question, frameset
should not be included in the body
element.
Try it at: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_frame_cols
Is it a website with frames and framesets well designed?
You can start improving it by removing frames.
- Frames have been obsolete for a long time and have been removed completely in HTML5.
- They're are better ways of accomplishing a common layout using server side technology like PHP includes or SSI.
- Plus frames are not good for accessibility or usability.
- They are not search engine friendly
- They break the rule of one URL fer page
- They are not easy to maintain. It can be tough to figure out exactly which page you are viewing.
- Mobile devices probably are going to have a hard time rendering those pages properly.
- Users can't bookmark a page since every page uses the same URL
Is there any website built by HTML frames? Should I learn this topic?
No. It is an extremely old concept that has been out of use for a long time, and is now even deprecated in the spec and may eventually stop working / being supported in browsers.
When I started building websites seriously about 10 years ago they were an old and long out of general use concept then.
If you were bored and just wanted to learn it for historical purposes then have fun. But there is absolutely no practical value in knowing frames.
Skip it. In fact, just tear those pages out. They're not even worth the added weight to the book.
Note: iframes
are a completely different thing and are very much in use and you should know them...just specifically frames forget about.
Related Topics
Why Cannot Change Checkbox Color Whatever I Do
How to Select a Radio Button by Default
Contenteditable=False Inside Contenteditable=True Block Is Still Editable in IE8
How to Get a List of All Countries/Cities to Populate a Listbox
White Space Inside Xml/HTML Tags
How to Center the Contents of a Div
Selecting the Last Element Among Various Nested Containers
Html/CSS How to Add Image Icon to Input Type="Button"
How to Keep Footer at Bottom of Screen
Is It Bad to Use Uppercase Letters for HTML Tags
How to Change the Opacity (Alpha, Transparency) of an Element in a Canvas Element
Why Are My Div Margins Overlapping and How to Fix It
Manipulating External Svg File Style Properties with CSS
Can <Span> Tags Have Any Type of Tags Inside Them
Is It Semantically Incorrect to Put a <Div> or <Span> Inside of a <Button>