|
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!
Categorized:
HTML and CSS
(Article 3711,
Written by Dave Taylor)
Tagged: Previous: BlogAds: An Advertising Network specifically for Weblogs Next: Three Ways to Adversely Impact your Google Pagerank Subscribe!
Hi Dave, Thank you for your clear concise instruction. I was trying to figure out how to display the contents of a google search in a frame. I read one of your resonses to a Web designer who wanted to prevent people from displaying his content in their frames and understood why I would not be able to do it. Thanks. I have something to say, now that you mention it, but ...
I do have a comment, now that you mention it!
|
Recommended
Recent Entries
Search
I Need Help!
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and RSS Feeds Building Web Site Traffic Business and Management CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above Facebook Help Google Plus Help HTML and CSS Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Mac OS X Help Pay Per Click (PPC) Advertising Search Engine Optimization (SEO) Shell Script Programming Tech Support Video Help The Writing Business Twitter, LinkedIn and Social Network Help Unix and Linux Help Video Game Tips and Help Windows PC Help WordPress Help |