
How do I get links to work on a frames-based design?
A reader writes:
"I have been reading your "Creating Cool Web Pages (HTML 4), and I just understood how to make frames. However, I am having trouble with my links opening in the same frame.This is probably the most common challenge people face when they begin to work in a frames-based environment, and the trick to getting this working has two parts: First, you must name each target pane of your frames-based design when you specify it, and Second, you need to use that exact same name as a target attribute with all links you want to point there. For example, here's a common approach that you might use to specify a frames-based layout. Notice in particular the words in bold: <frameset cols="100,*">You should recognize this as a two-column layout, where the left column is going to start out with the page "navbar.html" while the right column, the main section of the frame, is going to be "welcome.html" to start. With me so far? To have the links in the file "navbar.html" actually affect the content of the other pane of the frames-based design, they must reference the name of the pane as specified in the frame statement: name="main". Here's how that would look: <a href="http://www.intuitive.com/">Intuitive Systems</a>Right? No! It's not correct, because I forgot the all-important target attribute. It's easy to do. Here's the correct version of the link: <a href="http://www.intuitive.com/" target="main">Intuitive Systems</a>See the difference? It's not too hard once you remember that you need to specify a target if it's other than the existing pane. Even better, you can also specify something like: <base target="main" />which means that all links on this particular page are now pointing to the other pane. You override this, if needed, with an explicit target="_self". I hope that clears everything up!
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon
Categorized:
HTML and CSS
(Article 3711)
Tagged: Previous: BlogAds: An Advertising Network specifically for Weblogs Next: Three Ways to Adversely Impact your Google Pagerank Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.
Rather amazingly, there are no comments on this article yet.
I have a lot to say, but ...
I do have a comment, now that you mention it!
|
![]() Join Me At:
Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Join the List!
Book Links
|