Click to See Complete Forum and Search --> : frames
z_mirza
01-10-2003, 10:06 PM
hey guys, im new to html and i wanted to have my links on the left frame and when i click one of those links it pops up the page on the right side of the frames, heres some of my code real basic right now...
<html>
<head>
<title>Main</title>
<frameset cols="200, *">
<frame name="leftFrame" src="links.htm">
<frame name="rightFrame" src="test.htm">
</frameset>
</head>
</html>
gokou
01-11-2003, 01:06 AM
<html>
<head>
<title>Main</title>
<frameset cols="200, *">
<frame name="leftFrame" src="links.htm">
<frame name="rightFrame" src="test.htm">
</frameset>
</head>
</html>
The target command and the name of the fram is the key to making it work. To make one of the links go in the right frame you have to make the link target the name of the right frame.
EXAMPLE:
<a href="http://www.cnn.com" target="rightFrame">Cnn</a><br>
<a href="http://www.htmlgoodies.com" target="rightFrame">Html Goodies</a><br>
Using the target command leads it to the right frame.
z_mirza
01-11-2003, 11:30 AM
hey thanx for the info, but im still not excatly sure how it will work i tried your method and well, its a nogo i bet this seams like a really simple task but i just started using html like 3 days ago so any help will be really usefull. thanx
In your links.htm page, add this in between the <head> and </head>
<base target="rightFrame">
That will tell all links in the links.htm page to open in the rightFrame.
khalidali63
01-11-2003, 11:47 AM
You already have this code
<html>
<head>
<title>Main</title>
<frameset cols="200, *">
<frame name="leftFrame" src="links.htm">
<frame name="rightFrame" src="test.htm">
</frameset>
</head>
</html>
now here is what you do.
in th elinks.html page
create links like this
<a href="http://www.cnn.com" target="rightFrame">Cnn</a><br>
<a href="http://www.htmlgoodies.com" target="rightFrame">Html Goodies</a><br>
and open the page that has the frame code.
all of these files should be in same directory.
you should see 2 links in the left frame.and when clicked on a link it will open page in the right frame.
I hope its a bit more descriptive..
Khalid
z_mirza
01-11-2003, 11:49 AM
oh wow thanx for the quick replies guys ill try it now and post if i get any more problmes, thanx again
Stefan
01-11-2003, 06:06 PM
Just like to point out that you have an incorrect page there.
The <frameset> is supposed to take the place of the <body> of the page, and is thus NOT supposed to go in the <head> seaction.
A correct frameset might look something like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
</head>
<frameset cols="100, 1*" border="0"> <!-- border="0" is a bugfix for incorrect frameborder=0 support in IE, NS as well as Opera -->
<frame name="nav" src="nav.html" frameborder="0" marginwidth="1" marginheight="1" scrolling="auto">
<frame name="main" src="main.html" frameborder="0" marginwidth="1" marginheight="1" scrolling="auto">
<noframes>
<body>
<p>
Frames are not working in your Browser.<br>
You can reach the respective pages on the frames via these links<br>
<a href="nav.html">Navigation</a><br>
<a href="main.html">Main</a>
</p>
</body>
</noframes>
</frameset>
</html>
z_mirza
01-11-2003, 06:51 PM
dude, i just started html like 3 days ago, gimme a break man lol but thanx anyway
Zach Elfers
01-11-2003, 06:55 PM
Your doing pretty good for three days of learning.
z_mirza
01-11-2003, 07:02 PM
thanx alot, just following my bro;s footsteps, i wanna reach where he is today, and replace him at his job so he can further his education
Stefan
01-11-2003, 07:53 PM
Originally posted by z_mirza
dude, i just started html like 3 days ago
The best time to learn how to do things the right way is at the beginning :)
That way you don't have to fix a lot of pages and unlearn bad habits later on :)
z_mirza
01-11-2003, 07:56 PM
thx for the advice and btw i did try it your way and it worked out as well, thanx everyone
happy HTMLing