HTML/CSS Targeting Frames in HTML: Code to Open Pages in Each Frame

  • Thread starter Thread starter kasi9
  • Start date Start date
  • Tags Tags
    Frames
AI Thread Summary
To target a specific frame when clicking links in an HTML frameset, it's essential to define the frames correctly in the frameset page using the <frame name="..."> attribute. The links should then use the target attribute, such as <a href="..." target="frameName">, where "frameName" corresponds to the name assigned to the desired frame. Issues may arise if the frames are not named correctly or if the linking structure is flawed. It's crucial to ensure that the frame names are defined in the frameset page, not in the content pages. If problems persist, sharing the actual code may help others identify the issue more effectively.
kasi9
Messages
4
Reaction score
0
in html, i have coded a site with 8 frames i'd say approx, i have a menu with links, when i click on the link i want a page to open in a particular frame, so how do i target it, please give me code, ty

btw _self, _blank etc don't work, i think i need to some how name the frames, to open up pages in each of them
 
Technology news on Phys.org
Try
Code:
<frame name="contentFrame">
where you define your frames, then
Code:
<a href="..." target="contentFrame" ...>
 
i put <frame name=> in the page i want the link to open in

and the <a href...> link in the other fram where the links go

but it still doesn't work, any more ideas?
 
kasi9 said:
i put <frame name=> in the page i want the link to open in

and the <a href...> link in the other fram where the links go

but it still doesn't work, any more ideas?

CompuChip's suggestion is the way to do this, but there could be other problems depending on how you are linking to the other page which is really hard to determine without looking at your code.
 
kasi9 said:
i put <frame name=> in the page i want the link to open in

and the <a href...> link in the other fram where the links go

but it still doesn't work, any more ideas?

If you're using frames, then you have a main html page - the frameset page - which contains all the other frames, plus some content pages which have the content for each frame.

Go into the frameset page and name the frames. Adding <frame name=> into a content page will not do it - it may be obvious but from what you said it sounds like that's what you did.
 
well guys I'm trying, i renamed some of the frames, and whe i click the link it opens the page in the link page :(

i appreciate ur help so far, but this seems impossible
 
kasi9 said:
well guys I'm trying, i renamed some of the frames, and whe i click the link it opens the page in the link page :(

i appreciate ur help so far, but this seems impossible

I'll say this again that it is really difficult to help you find the problem when none of us knows exactly what you are doing, if you would post some of the code you are working on it is more likely that someone would be able to spot the problem.
 

Similar threads

Replies
9
Views
2K
Replies
2
Views
1K
Replies
5
Views
2K
Replies
3
Views
2K
Replies
2
Views
2K
Replies
4
Views
3K
Replies
3
Views
3K
Back
Top