Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-21-2011, 09:22 PM   PM User | #1
n00b_padawan
New to the CF scene

 
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
n00b_padawan is an unknown quantity at this point
Cool child target within a parent target

Hi, I am trying to link to a target div element within a target object element in one link. This is confusing, so I'll explain.
In my 'INDEX.HTML' I have an object(where the data comes from a separate page).

CSS/HTML looks like this.
Code:
     #page2{display:none;}
     #page2:target{display:block;}

    <object data="SEPERATEPAGE.HTML" id ="page1" height=400 width=600></object>
Now, within that SEPERATEPAGE.HTML I have a similar commands.
Code:
      #section1 {display:none;}
      #section1:target {display:block;}

      <div id="section1">Here is the content I'm trying to link to</div>
And So, my question is How do I link from INDEX.HTML to #section1 displayed as a block within #page2 ?

My link is placed in a #page1 object (also a seperate page similar to the #page2)

I tried this with no avail
Code:
<a href="#page2#section1" target="_parent">Super Epic Link</a>
Is this possible? My #page2 is a blog section of the site, where #section1 is a blog entry. I want to link from outside of #page1 itself so I can feature it on other parts of the site etc. It means less clicks for my end users.
n00b_padawan is offline   Reply With Quote
Old 09-22-2011, 05:21 AM   PM User | #2
chaule
New Coder

 
Join Date: Aug 2011
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
chaule is an unknown quantity at this point
Hi,

I'm not quite sure I am clear on what you're trying to do.. You are trying to link from one page to the section of another page?

Try using:
Code:
<a href="SEPERATEPAGE.HTML#section1">Super Epic Link</a>
where the #section must be an anchor you drop into where you want to jump to (which will be within SEPARATEPAGE.HTML somewhere):
Code:
<a name="section1" />
That is if you just want to like to the section. Unless you wanted to actually preview the actual part of the page from within INDEX.html without leaving the index page?

Last edited by chaule; 09-22-2011 at 05:34 AM..
chaule is offline   Reply With Quote
Reply

Bookmarks

Tags
display, link, object, parent, target

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:47 PM.


Advertisement
Log in to turn off these ads.