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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    105
    Thanks
    12
    Thanked 1 Time in 1 Post

    How To Code An Anchor...?

    Quote Originally Posted by W3C Schools
    Tip: In XHTML, the name attribute of the <a> tag is deprecated, and will be removed. Use the id attribute instead.
    So how do I write an anchor in my code?

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,728
    Thanks
    41
    Thanked 191 Times in 190 Posts
    still <a> ... they are saying you cannot do <a name="whatever"> use <a id="whatever">

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • Users who have thanked alykins for this post:

    Daniel_A_Varney (07-13-2011)

  • #3
    Regular Coder
    Join Date
    Jul 2011
    Posts
    105
    Thanks
    12
    Thanked 1 Time in 1 Post
    So, do I still use:

    <a href="page1.htm#here">Click here</a>

    while using:

    <a id="here">Bookmark</a> ?

    It's just name exchanged for id, is it?

    Thank you.

  • #4
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Quote Originally Posted by Daniel_A_Varney View Post
    So, do I still use:

    <a href="page1.htm#here">Click here</a>

    while using:

    <a id="here">Bookmark</a> ?

    It's just name exchanged for id, is it?

    Thank you.
    Yes. The only time you could be using name is for forms.

  • #5
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,642
    Thanks
    6
    Thanked 1,005 Times in 978 Posts
    Quote Originally Posted by Daniel_A_Varney View Post
    So, do I still use:

    <a href="page1.htm#here">Click here</a>

    while using:

    <a id="here">Bookmark</a> ?

    It's just name exchanged for id, is it?

    Thank you.
    In fact, you don’t need anchors as – well – anchors, you can link to any element with an ID. For example:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    	<head>
    		<title></title>
    		…
    	</head>
    	<body>
    		<div id="container">
    			<div id="header">…</div>
    			<hr />
    			<div id="content">…</div>
    			<hr />
    			<div id="footer">
                                …
                                <a href="#container">link</a>
                            </div>
    		</div>
    	</body>
    </html>
    The link would make the page jump to the element with ID “container”, e. g. the top.

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Wait.. you shouldn't use an extra anchor tag to specify the target of another anchor. You may set the id attribute on any element, and target it using an anchor with #<id> in the href. See http://www.w3.org/TR/html4/struct/links.html#h-12.2.3
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #7
    Banned
    Join Date
    Aug 2010
    Location
    USA
    Posts
    16
    Thanks
    0
    Thanked 1 Time in 1 Post
    Opens In Same Browser Window

    1.The <a> tag in html code is an Anchor Text Tag. The following example will provide some common uses of the <a> Anchor Tag.

    In html you begin the <a> Anchor Tag with:

    <a href=”http://yourdomain.com”>

    You close the html Anchor Tag with:

    </a>
    The end of this 1st step looks like this:
    <a href=”http://yourdomain.com”>Your Anchor Link Text Goes Here</a>
    This is one way that this anchor text Hyperlink will finally look (Could Depend on Cascading Style Sheets-CSS):

    Your Anchor Link Text Goes Here

    Cut & Paste the following into your html editor and modify the information:
    <a href=“http://yourdomain.us”>Change the Domain URL then place your Keyword Rich Text Here!</a>


  •  

    Posting Permissions

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