HTML: Link Targets

Discussion in 'Computer Science & Culture' started by Tiassa, Nov 3, 2011.

Thread Status:
Not open for further replies.
  1. Tiassa Let us not launch the boat ... Valued Senior Member

    Messages:
    37,891
    HTML: Link Targets

    Naturally, I'll be spending some time looking at how other web pages are marked up, but I thought perhaps we might also be able to generate some discussion here.

    The question is targets. The several tutorial pages I have looked through use nearly identical explanations, and restrict themselves to _blank, _self, _parent, and _top. In truth, these days, the only one I use is _blank:

    Code:
    <a href="URL" target="_blank">
    This, of course, launches the target link in the new page.

    My question derives from the Mozilla net suite, which included an HTML authoring function that used button controls to assign targets within a single page. That is: If I want to link an endnote marker—i.e., [1]—to its actual endnote, what is the markup syntax?

    The generic explanations of the HTML Target Attribute for Anchors don't seem to cover that.

    It should be easy enough to review, say, a Wikipedia page, but that will still take a while. Is there a quick explanation?

    The reason is that I intend to change my blogging habits to reflect something I'm doing at Sciforums. The blogosphere is notorious for bad source attribution. As long as a link doesn't break, the issue isn't particularly serious. But I don't see a target button in either of the online blog editors I use (Wordpress, Blogger), and figure it might be useful to allow readers to hop back and forth between the primary text and the citation. As such, I need to figure out how to mark up the target tags for both the in-text marker and the endnote itself, so that one can simply click to jump down and then back up.

    It was easy enough with Mozilla, and, certainly, I can give Seamonkey a whirl. But I'd also prefer to learn how to write the markup myself.

    Can anyone offer any advice?

    Many thanks.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Chipz Banned Banned

    Messages:
    838
    I am assuming you're referring to page anchors. Page anchors allow you to assign a link to another location on the same page.

    Eg:
    Code:
    Some text [1]  
    
    
    [1]
    Clicking on the top [1] would send you to the bottom.

    You would assign the top [1] with this code.
    Code:
    <a href="#citation_1">[1]</a>
    And the bottom [1] with this code:
    Code:
    <a name="citation_1">[1]</a> Additional information about 1.
    Additionally you could put the citations on a separate page, if that page has anchors. So the first tag would be.
    Code:
    <a href="some_page.html#citation_1" target="citation_page">[1]</a>
    
    All anchors would open up in the same window named citation_page (I think), preventing multiple windows all over the place.

    This works as long on the targeted page (some_page.html) there's somewhere a corresponding anchor named "citation_1".
     
    Last edited: Nov 3, 2011
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. Tiassa Let us not launch the boat ... Valued Senior Member

    Messages:
    37,891
    Thank ye

    Gorgeous. Thank you.

    (That's the problem with suite authoring; I never learned basic markup until I started blogging. And that's only body markup; I still leave doc, CSS, and meta to whatever software I'm using.)
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
Thread Status:
Not open for further replies.

Share This Page