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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Apr 2014
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    HTML links and hyperlinks question

    I am having trouble with hyperlinks. For my assignment I had to link two assignment, titled Invitation and Web Master Roles, to a main page: Portfolio. I used internal linking to do so. I also had to include a mailto link. I also did this with no problem. However, I also have to add a link at the bottom of the Invitation and Web Master Roles pages back to the portfolio. This is where I am running into problems! In the lesson it taught us about ID tags. However when I try to create the links, they just appear on the portfolio page and not on the Invitation/Webmaster pages. Here is what my code looks like so far.

    <html>
    <title> Portfolio </title>
    <style type="text/css">
    A:LINK {
    color:#009900;
    font-size: 22;
    font-family: Courier New;
    }
    A:HOVER {
    color: #0000FF;
    font-size: 22;
    font-family: Courier New;
    }
    A:VISITED {
    color: #FF0000;
    font-szie: 22;
    font-family: Courier New;
    }
    .pagetitle {
    color: black;
    font-size: 40;
    font-weight: bold;
    font-family: Courier New;
    text-decoration: underline;
    text-align: center;
    }
    </style>
    <p span class="pagetitle">My Portfolio </p>
    <body>
    <id= "mainmenu">
    <head>
    <center>
    <p><a href="Portfolio/unit2/invitation/Invite2.html"> Invitation </a> </p>
    <p><a href="Portfolio/unit2/CSSassignment.html">Webmaster Roles</a></p>
    <p><a href="mailto:johndoe@abc.com"> Contact me </a></p>

    So my question is: how do I create hyperlinks on the two separate pages, back to the main Portfolio page?
    I have tried so many different ways and none are working!
    Please HELP!
    Thanks! :-)

  • #2
    New Coder
    Join Date
    Jan 2013
    Location
    Sunnyvale, CA
    Posts
    98
    Thanks
    6
    Thanked 7 Times in 7 Posts
    what is the physical path to your portfolio.html page?

    What is your physical path to the other pages?

    I believe that you need to reference your portfolio page with an href that points to a different folder. Basically, I am guessing that your links are searching for the file in the same folder where they themselves exist, and are not finding it because it is located elsewhere.

    Basically, use ../ to navigate to the directory that is the parent of the directory where your current page resides.

  • Users who have thanked sbhmf for this post:

    caitfor. (04-05-2014)

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,624
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    If this is the path to the invitation page: Portfolio/unit2/invitation/Invite2.html then you need to edit that invitation page to insert a link with the reference path ../../../portfolio.html. This basically tells the browser: “move up three levels (in the directory structure) and then look for a file called portfolio.html”. The other file is located directly in the unit2 directory so there you just need to move up two levels.

  • Users who have thanked VIPStephan for this post:

    caitfor. (04-05-2014)

  • #4
    New to the CF scene
    Join Date
    Apr 2014
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Instead of using an internal link, would it be better to use an external link so that the actually code of each page is in the portfolio code? The invitation and webmasters roles pages are both in a folder on my desktop and the portfolio.html code is just what you see above.
    I have never used reference links but I'll give it a try! Thanks!

  • #5
    New Coder
    Join Date
    Jan 2013
    Location
    Sunnyvale, CA
    Posts
    98
    Thanks
    6
    Thanked 7 Times in 7 Posts
    Not sure what it is you are asking...:

    What you see/create as a link is actually, when clicked, a request from the addressed server for a file whose name and location on the server is the path and filename in your anchor element.

    Again: It's nothing more elaborate than a simple request for a file.

    while the entire application resides on your desktop computer it will be entirely accessible exclusively on your machine. For obvious reasons, when you deploy your project on a web server it will no longer be capable of requesting files that reside on your desktop, since your computer is (presumably) not a web server.

    As long as your links are requesting files that reside locally you may use relative hyperlink-references in your anchor elements. When you request links from other servers you will obviously be required to reference the full address.

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,624
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    Quote Originally Posted by caitfor. View Post
    I have never used reference links but I'll give it a try! Thanks!
    I’m also not sure what you are asking but you have used links before, as you showed in your first post.
    This:
    Code:
    <a href="Portfolio/unit2/invitation/Invite2.html"> Invitation </a>
    …is a link to your invitation page. The href attribute has a reference to the invitation page. Makes sense?

    Now, let’s look at your file structure. I assume you have your portfolio page in the root directory, so by looking at the values of the href attributes of your links the file structure appears to be this:
    Code:
    portfolio.html
    /Portfolio
      /unit2
        CSSassignment.html
        /invitation
          Invite2.html
    So, in the root directory there is the portfolio.html page and the Portfolio directory. Inside that directory you have the unit2 directory and inside that one there is the CSSassignment.html page and the invitation directory, and in that one is the Invite2.html page. I wouldn’t know why you would want to put an external link to link back to the portfolio page? Because there is nothing external on your site. An external link would be a link to another site/server, such as if you were linking to google.com.


  •  

    Posting Permissions

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