SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    731
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Link On Own Page - Correct Code

    Hi,

    I am trying to link to a location on a page using an id however whatever code I try it adds a link affect to the target.

    The "Contact Us" below has a link affect, can anyone advise how to link to text but not add an affect?


    Code:
    <a id="contact" class="links" >
    <div class="indexmainintro">
    		Contact Us
    </div>
    </a>


    Code:
    <div class="indexmainintro">
    <a id="contact" class="links" >
    		Contact Us
    </a>
    </div>

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,786
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    You should be coding the destination like this (without the <a> tag):

    <div class="indexmainintro links" id="contact">Contact Us</div>
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Guru
    Join Date
    Feb 2007
    Posts
    731
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Brilliant cheers mate.


Bookmarks

Posting Permissions

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