Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Member
    Join Date
    Aug 2008
    Location
    Utah, USA
    Posts
    38
    Member #
    17184
    Hi again. I have one page set up with several thumbnails that need to link to a different page, but each link needs to go to a different part of the page (eg. one to the top, one to the middle, one to the bottom). How do I go about doing that in Dreamweaver CS3? Thanks.

  2.  

  3. #2
    Senior Member diddy's Avatar
    Join Date
    Jun 2008
    Location
    Sydney, Australia
    Posts
    502
    Member #
    16955
    I think you're talking about anchors (i think that's what they're called)

    So if you've got an image or something halfway down the page, you could wirte in the tag
    <img src="test.jpg" width="200" height="300" alt="" name="one" />
    Then you would make a link to it. In the link, you would write this:
    <a href="#one">click here</a>
    You can use this with ID's, in the same way. The link will stay the same but instead of name you would put id.

    I don't think I'm explaining this very well, but I've attached a sample.

    Hope this helps!.

  4. #3
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    It is worth noting that you should use id="" instead of name="".

    Using name, depending on your chosen DOCTYPE could make your pages fail validation.

    If you use ids you should be safe for a good few years yet.

    Also it has the advantage that you can style that element as well by using the id as an.. identifier in your CSS declarations.

  5. #4
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    Your image anchor didn't work Diddy. This works.

    <a href="#1">go to picture</a>

    <a name="1" id="1"><img src="pic.jpg"/></a>

    Just code it by hand setabkcin, it's just easier. I have DWCS3 but some things are just esier to do yourself.

    I have copied the help part from DW if you want it though.


    Link to a specific place in a document

    You can use the Property inspector to link to a particular section of a document by first creating named anchors. Named anchors let you set markers in a document, which are often placed at a specific topic or at the top of a document. You can then create links to these named anchors, which quickly take your visitor to the specified position.
    Creating a link to a named anchor is a two-step process. First, you create a named anchor; then you create a link to the named anchor.
    Note: You can’t place a named anchor in an absolutely positioned element (AP element).


    Create a named anchor
    1. In the Document window’s Design view, place the insertion point where you want the named anchor.
    2. Do one of the following:
      • Select Insert > Named Anchor.
      • Press Control+Alt+A (Windows) or Command+Option+A (Macintosh).
      • In the Common category of the Insert bar, click the Named Anchor button.
    3. In the Anchor Name box, type a name for the anchor, and click OK. (The anchor name can’t contain spaces). The anchor marker appears at the insertion point.
      Note: If you do not see the anchor marker, select View > Visual Aids > Invisible Elements.
    Link to a named anchor
    1. In the Document window’s Design view, select text or an image to create a link from.
    2. In the Link box of the Property inspector, type a number sign (#) and the name of the anchor. For example, to link to an anchor named “top” in the current document, type #top. To link to an anchor named “top” in a different document in the same folder, type filename.html#top . Note: Anchor names are case-sensitive.
    Link to a named anchor using the point-to-file method
    1. Open the document containing the named anchor. Note: If you don’t see the anchor, select View > Visual Aids > Invisible Elements to make it visible.
    2. In the Document window’s Design view, select text or an image you want to link from. (If this is another open document, you must switch to it.)
    3. Do one of the following:
      • Click the Point-To-File icon (target icon) to the right of the Link box in the Property inspector and drag it to the anchor you want to link to: either an anchor within the same document or an anchor in another open document.
      • Shift-drag in the Document window from the selected text or image to the anchor you want to link to: either an anchor within the same document or an anchor in another open document.

  6. #5
    Senior Member diddy's Avatar
    Join Date
    Jun 2008
    Location
    Sydney, Australia
    Posts
    502
    Member #
    16955
    Quote Originally Posted by aeroweb99
    Your image anchor didn't work Diddy. This works.

    <a href="#1">go to picture</a>

    <a name="1" id="1"><img src="pic.jpg"/></a>
    Didn't it? I viewed and tested it with IE and it worked, but I agree that using ID is better, just thought I should point out that name sometimes works.

    But setabkcin, us ID's, not names (or ID's and names). Bfsog makes a good piont about styling.

  7. #6
    Member
    Join Date
    Aug 2008
    Location
    Utah, USA
    Posts
    38
    Member #
    17184
    I got this to work but I'm trying to link to a div on a different page. The # link leaves you on the same page (we all know this), so how do you set up the link to go to a different page then to the div? I tried linking like this: page.htmlapdiv16 (apdiv16 being my id for the div). But, that doesn't work. Thanks again.

  8. #7
    Member
    Join Date
    Aug 2008
    Location
    Utah, USA
    Posts
    38
    Member #
    17184
    Nevermind, I just saw aeroweb99's post and found the solution. Thanks everybody.

  9. #8
    Senior Member diddy's Avatar
    Join Date
    Jun 2008
    Location
    Sydney, Australia
    Posts
    502
    Member #
    16955
    I think that when you are linking to an anchor, it's worth noting that if you want to link to the top of the page, #top workss in Internet Explorer, but not in Firefox. Instead I suggest you just use # after the filename. This works across both browsers.

  10. #9
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    It doesn't matter what you name it, the link will work if it's coded correctly.
    Look at the source code on one of my site's pages, I have them numbered.
    Example

  11. #10
    Senior Member diddy's Avatar
    Join Date
    Jun 2008
    Location
    Sydney, Australia
    Posts
    502
    Member #
    16955
    You have a div or something named top, so linking to that with #top works, I have no problems with that, but what I'm saying, is that if you make a link to #top but there isn't anything named or id'd 'top', it just goes to the top of the page in IE but not in FF.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:07 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com