Dismiss Notice
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

XHTML - how to direct a link to open in a frame?

Discussion in 'Programming' started by student3, Jul 28, 2012.

  1. student3

    student3 New Member Webmaster

    I'm currently learning XHTML. What's the easiest way to get a navigation bar to remain on the index page after clicking one of its links? I'm thinking frames but is there an alternative way to achieve a menu that doesn't open its links in the same window (because this means that the menu disappears)

    In HTML I would use the following (if I wanted the links to open in a iframe):

    <iframe src="welcome.html" id="frame1"></iframe>

    <p><a href="page1.html" target="frame1">Menu item</a></p>

    But how can I modify this code so that it works and validates in XHTML? "target" is invalid in XHTML. What can I use instead?

    Note that it doesn't have to be an iframe or a frame for that matter. As long as there's a way to 'fix' the menu so that it remains on the index page after clicking a link. The most logical thing seems to be to 'target' it to open in a frame but do correct me if I'm wrong.

  2. Shalin

    Shalin New Member Webmaster

    Frames or iFrames are very bad idea, we don't use it in these days.

Featured Resources (View All)

Share This Page