...

View Full Version : linking html to html to iframe



sairos
04-14-2011, 10:09 AM
hi to all...
i'm a newbie in HTML stuff and now im building my first website however i have this problem encountered..

does anybody know how to link an html to another html w/ iframe?
confusing eh?

well to illustrate i have this "index.html" and i use
<a href="page2.html">go to item2</a>
to go to page2.html.

inside the "page2.html" i have
<div class="frame">
<iframe ="sampleframe.html" ></iframe>
</div>

and inside the "sampleframe.html"
there are three <p> with an id of item1, item2,item3..


what i want is when i click the "go to item2" button from the index.html i would be redirected to the <p id="item2">sample sample </p> in sampleframe.html

i hope you could help me with this problem.. thanks a lot.

thomasmclennan
04-15-2011, 07:03 AM
I suggest you restructure your site like this, if it's your first site.

page1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>sairos</title>
</head>


<body>

<!--#include virtual="/navigation.html" -->
<h1>Page 1!</h1>
<p>Hello World</p>
</body>
</html>

navigation.html
<ul>

<li><a href="home.html">HOME</a></li>
<li><a href="page1.html">PAGE 1</a></li>
<li><a href="page2.html">PAGE 2</a></li>
</ul>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum