dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: links within the page help

  1. #1
    Join Date
    Jul 2014
    Posts
    8

    links within the page help

    ok so im taking a udemy course, well a couple of them. but on one of them he is talking about links within the page. and he said take out the <p> tag and replace it with <a name"name"> then paragraph. but he didnt say if i needed to replace the ending </P> tag with a </a>tag so i went and looked at w3 school. it is showing using an id tag, it is for <h1> but should i use a <a> tag and instead of <p> or should i use the id tag? and how should i end that paragraph, which tag? if i use the <a> tag do i end it with </a>

  2. #2
    Join Date
    Mar 2012
    Posts
    1,833
    I do not wholly understand your problem. Yes an <a> must be closed with an </a>, but you should not have a <p> tag inside an <a> tag. Also <a> should be used as a link, not as the target of a link. Use <div id="name"> or <p id="name"> as a target.

    Does that answer your query?
    Last edited by jedaisoul; 07-16-2014 at 05:12 PM.

  3. #3
    Join Date
    Jul 2014
    Posts
    8
    ok i think so. the guy who is "teaching" the course on udemy. said to change out the <p> tag and use the <a> tag instead. but he never changed the ending tag so i was confused. i think i got it now. i was just really confused for a second. i dont know why the guy said use <a name="name"> instead of <a id="name">. its a stupid question looking back now, guess my mind is not working today lol

  4. #4
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    All tags need to be closed, either with an ending tag or they're "self-closing". For example, for links within a page:

    HTML Code:
    <!-- the id isn't used for re-directing but can be used for CSS styling -->
    <a href = "#section1" id = "link1">Click to go to Section 1</a>
    <!-- the ID in the <div> is used for referencing within an internal page 
     but also can be used for CSS styling -->
    <div id = "section1">
         <p>some stuff</p>
    </div>
    I chose to link to a <div> but you can link to other HTML elements instead.

  5. #5
    Join Date
    Jul 2014
    Posts
    8
    ok thanks i apperciate it i really dont know why it confused me so much. thank you error404 i apperciate you using code to show me so i can look at it and study it.

  6. #6
    id is used for the identity . <a> is used for linking with href .<p> is simply for paragraph text .it is a very easy part of html ,

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles