Intermediate HTMLLesson 2: Intermediate Page DesignFrames are out, but they're also in
For a while back in the '90's framesets were considered extremely cool. Everyone put their menus into one frame, their header in another, and their page content in a third. The main advantage to using frames was that it was a way to get the same menu or header on multiple pages without having to cut and paste HTML onto each page. The advent of web specific scripting languages such as Cold Fusion, ASP and JSP have eliminated the need for frames by introducing the simple "include" syntax. In ASP, for example, (assuming you're on an ASP enabled Windows server) you just name a page something.asp instead of something.html and put the code <!--#include file="somethingelse.inc"-->where you want the menu or header or whatever to be. Probably the main reason frames have dropped out of favor, however, is that they make it very hard for search engines to spider a website properly. And NO webmaster wants to discourage search engines from listing their site!! So the frameset is passé. But its cousin, the inline, or floating frame is very much in vogue. It's used to insert content from a different URL into a pre-measured box on a page. For example, MSNBC's home page has two inline frames, each of which is used to display an ever varying set of advertisements. If you go to their site and view their source, you can do a search on the word iframe and you'll see them. Try cutting and pasting the code between <iframe... and </iframe> into a fresh page and running it in your browser while you're connected to the web. It's kind of a hoot. (What can I say. I'm easily amused.) Frequently, a feed from a news provider is displayed in an inline frame. Any dynamic, frequently changing content is a good candidate for an iframe. There are thousands of sites on the web that offer free, constantly changing content that you can include in your site via an inline frame. For example, WebProWorld, an excellent and very popular site with webmasters, offers "reports and tutorials, updated daily" with "the latest in online news and tips" that they're so eager for you to include in your web pages that they have little boxes on their promotional page -- the boxes themselves are inline frames -- with prefab code to cut and paste into your pages. Here's the basic syntax: <iframe src="something.htm" name="somename" width="somenumber height="somedifferentnumber"><iframe> For all the permutations, see pages 248-249 in your text. Inline frames are clean, easy to code, subservient to your page so search engines don't mind them, and they look like part of your page so visitors don't even know they're there. A great way to update content frequently without having to mess with your whole page. Whoa! Are we finished with the lesson already? How time flies!
Here's your homework: I can't wait to see it! BibliographyCastro HTML for the World Wide Web, 5th Edition, Chapters 14 and 15 |