Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    how to make this reference-link work?

    Dear All


    Suppose I want to make a one page html like the following:

    ***************
    Table of Contents
    1. Part 1
    2. part 2
    3. Part 3

    ***************
    1. Part 1
      ...blah blah blah....Those will be contents for part 1...blah blah blah....
    2. Part 2
      ...Those will be contents for part 2...
    3. Part 3
      ...blah blah blah....Those will be contents for part 3...blah blah blah....
    What I want to do is: I want to make those words in red (Part 1, Part 2, Part 3 )as links to their corresponding contents; for example, if visitors click part 2, the page will automatically navigate to
    • Part 2
      ...Those will be contents for part 2...
    How should I write HTML and/or CSS to make those links possible?
    Thank you very much!

  • #2
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    <a href="#logo"></a>

    http://www.ipowerweb.com/iboost/buil.../basic/782.htm

    I usually use:
    Code:
    <a href="#yada"></a>
    <a href="#rada"></a>
    
    <h2 id="yada"></h2>
    <h2 id="rada"></h2>
    ^ not sure whether that works :P I don't use internal links very often. The link I provided is the "correct" way of doing it
    Last edited by Sammy12; 07-10-2011 at 06:25 AM.

  • Users who have thanked Sammy12 for this post:

    littlestone (07-10-2011)

  • #3
    Regular Coder
    Join Date
    Jul 2011
    Location
    India
    Posts
    496
    Thanks
    3
    Thanked 57 Times in 56 Posts
    Quote Originally Posted by littlestone View Post
    Dear All


    Suppose I want to make a one page html like the following:



    What I want to do is: I want to make those words in red (Part 1, Part 2, Part 3 )as links to their corresponding contents; for example, if visitors click part 2, the page will automatically navigate to


    How should I write HTML and/or CSS to make those links possible?
    Thank you very much!
    Following is the code what you want .....
    Code:
    <p>***************</p>
    <p>Table of Contents </p>
    <ol>
      <li><a href="#part1">Part 1</a></li>
      <li><a href="#part2">part 2</a></li>
      <li><a href="#part3">Part 3</a></li>
    </ol>
    <p>***************</p>
    <a name="part1">
    <DL>
        <DT>Part 1</DT>
        <DD>...blah blah blah....Those will be contents for part 1...blah blah blah....</DD>
    </DL>
    <a name="part2">
    <DL>
        <DT>Part 2</DT>
        <DD>...Those will be contents for part 2...</DD>
    </DL>
    <a name="part3">
    <DL>
        <DT>Part 3</DT>
      <DD>...blah blah blah....Those will be contents for part 3...blah blah blah....</DD></DL>

  • Users who have thanked vikram1vicky for this post:

    littlestone (07-10-2011)

  • #4
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thank you all for great help.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •