Log in

View Full Version : CSS Frame Issue#1



bt1
06-04-2009, 07:09 PM
I am using CSS frames with a top and right static frames. I have some links in my right frame and want them to show up in the main content window. Everytime I hit the link it opens in a new window. Here is my code.....

<TD><IMG SRC="http://oak/eng/images/search.gif" WIDTH="20" HEIGHT="30" ALIGN="ABSMIDDLE">&nbsp;<a href="http://oak/eng/search/search.asp"><b>ENG Doc Search</b></a><br>
</TD>
Thank you, I am new to frame usage.

forum_amnesiac
06-05-2009, 06:51 AM
Make sure you give each of your frames a name, eg menu, main, etc., in the frame declaration.

In your links that you want to open in the main body, if the name you have given that is 'main', then add 'target="main"' to the <a href="something" line.

This should hopefully do the trick

bt1
06-09-2009, 01:21 PM
I am completely new to frames so I don't think that I am getting the name across correctly. How do I name the frame in the frame declaration section?

forum_amnesiac
06-09-2009, 01:50 PM
Here is a section of one of my pages where I call in the frames, you can see the names I've used.


<frameset framespacing="0" border="0" frameborder="0" bordercolor="#606060" rows="132,98%">
<frame name="top" scrolling="no" noresize src="hdr_top.htm">
<frameset cols="16%,78%,2%,3%">
<frame name="menu" src="menu.htm" scrolling="no" noresize>
<frame name="main" src="main.htm" noresize>
<frame name="spacer" src="home_spacer.htm" scrolling="no" noresize>
<frame name="right" src="logbotrgt.htm" scrolling="no" noresize>
</frameset>
<noframes>

When I do <a href="somepage.htm" target="main"> the new page, 'somepage.htm', opens up in the frame called 'main'

bt1
06-09-2009, 02:27 PM
From the css that I copied this seems to be where the frame is described...

#maincontent{
position: fixed;
top: 100px;
left: 0;
right: 245px; /*Set right value to WidthOfFrameDiv*/
bottom: 0;
overflow: auto;
background: #fff;
}
Then within my frame in the body I have this:

<TD><IMG SRC="myimage.gif" WIDTH="20" HEIGHT="30" ALIGN="ABSMIDDLE">&nbsp;<a href="http:mypage" target="maincontent"><b>MyDescription</b></a><br>
</TD>

Thank you for the time and patience.

forum_amnesiac
06-09-2009, 03:22 PM
To open the link you posted, in your main window, try adding this to it target="maincontent"

eg

<TD><IMG SRC="http://oak/eng/images/search.gif" WIDTH="20" HEIGHT="30" ALIGN="ABSMIDDLE">&nbsp;<a href="http://oak/eng/search/search.asp" target="maincontent"><b>ENG Doc Search</b></a><br>
</TD>

bt1
06-09-2009, 05:15 PM
I put that in and even opened the window fresh and it still is not working correctly. :confused: