Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    linking html to html to iframe

    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.

  • #2
    New Coder
    Join Date
    Jul 2010
    Posts
    33
    Thanks
    2
    Thanked 1 Time in 1 Post

    Cool

    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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •