Forum Moderators: not2easy

Message Too Old, No Replies

Converting Frame links to CSS

How do I convert a frames 'target=""' to css

         

Zaaka

11:03 am on Jul 25, 2006 (gmt 0)

10+ Year Member



Hi al I am pretty new to CSS styling and have recently decided to give it a go, but I am having problems with converting a traditional fram-based link to CSS, may be a silly question but here goes.

I have a link like this:-

<a href='services.htm' target='mainframe'>services</a>

now I have a Stylesheet that has a div ID of 'mainframe' how do i get the above link to work, or does the link have to point to a whole new page, meaning I cant load another html page into a div region?

[edited by: Zaaka at 11:03 am (utc) on July 25, 2006]

Setek

4:19 am on Jul 26, 2006 (gmt 0)

10+ Year Member



The link doesn't -have- to point to a whole new page, it's just easier that way. There is a way using javascript to replicate the target attribute in the same way as you want (sidenote: as at xHTML 1.0, the target attribute has been deprecated) as in, the functionality of frames.

<a href='services.htm' onclick="document.getElementById('div_name').innerHTML = 'this.href;return false;">services</a>

and:

<div id="div_name">replacable content here</div>

My javascript syntax may not be right, or it may be slightly more complicated than that, but the concept is there - it might be an idea for you to recheck this on the javascript board [webmasterworld.com].

Alternatively, there may be a solution I have missed.. anybody else have any ideas? :)

[edit]
I forgot a

return false;
after the other javascript code to stop the browser from replacing the content, and -then- redirecting the entire page to
services.htm
anyway.
[/edit]

[edited by: Setek at 4:26 am (utc) on July 26, 2006]