SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: links

  1. #1
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question links

    I am new to web page design. I've been fiddling around with (X)HTML for the past 2 weeks I've been using a book called Step by Step HTML and (X)HTML by Faithe Wempen and I've learned a quite a few things. One thing that I can't manage to do is get a multi page web site to link together so I can flow from the first page to the second and so on? If anyone knows how to do that I would appreciate it if you can tell me how .

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi vicgui and welcome to SitePoint

    When you say you cant get it to link together, what do you mean? Do you mean the actual code for links to and from each page or the flow of the site in general and the navigational ease?
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Location
    Amsterdam, NL, and France
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Hi,

    I've attached an extract from an article I wrote. It should help.

    Good luck

    Mike
    Attached Files Attached Files
    * * * * My site * * * *
    * * * * My paintings * * * *

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That extract isn't exactly helping. Some of your 'external' links won't work. For example,
    Code:
    <A HREF="www.my-web-site.com">click here</A>
    Ignoring the extremely bad practice of using 'click here' as anchor text, that link will not go to my-web-site.com. It will try to open a page named www.my-web-site.com in the same directory as the page that contains the link. You need to use an absolute URI for links to another server:
    Code:
    <a href="http://www.my-web-site.com">meaningful anchor text</a>
    @vicgui, using links from one page to another shouldn't be a problem. Let's say you have to pages, page1.html and page2.html, in the same directory. If you want a link to page2.html from within page1.html, the syntax looks like this,
    Code HTML4Strict:
    <a href="page2.html">link text</a>
    The 'link text' part is the text that will appear (blue and underlined by default) when you view page1.html in your browser.
    Birnam wood is come to Dunsinane

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Location
    Amsterdam, NL, and France
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought I heard a cuckoo and it isn't even Spring!! Line from a song. Or was it Lark? Hmm.

    My response isn't allowed as the system keeps finding links and/or email addresses. Mysterious.

    Anyway I've had to put it in an attachment. I've added some more helpful info and corrected a couple of Cuckoo's comments.

    Any more help needed just let me know Vicgui. My HTML Course's worth looking at, (even though I say it myself).

    Regards,

    Mike
    Attached Files Attached Files
    * * * * My site * * * *
    * * * * My paintings * * * *

  6. #6
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post

    I'm talking about the flow from one page to the next spikeZ such as the home page to the next,such as the family pictures page. I use this example because I'm trying to make a personal web site.

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you mean 'flow' as in automatic transitions from one page to the next? Like a slide show?

    That's not something you can do with HTML, which is a markup language. You'll need to use JavaScript for that, although it's not a very good idea to begin with. (Whatever transition speed you set will be too fast for some and too slow for others.)

    You can do it with a faked HTTP redirect, but that won't be supported by all browsers. For instance, allowing the visitor 5 seconds to study the page before going to the family pictures page:
    Code HTML4Strict:
    <meta http-equiv="Refresh" content="5;url=http://example.com/family_pictures.html">
    (This goes between <head> and </head>.)
    Birnam wood is come to Dunsinane

  8. #8
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Like any other page from the Home page you just click on the Events to be sent directly there?

  9. #9
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by vicgui View Post
    Like any other page from the Home page you just click on the Events to be sent directly there?
    If the Events is an image, you would place an anchor tag around that image.

    Code html4strict:
    <a href="events.html"><img src="images/menu/events.jpg" alt="Events"></a>

    If the Event is some text, you would place an anchor tag around the text.

    Code html4strict:
    <a href="events.html">Events</a>
    Last edited by paul_wilkins; Dec 16, 2008 at 01:20.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  10. #10
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Note that an image must have a text equivalent, though. That's especially important if it's used in a link.
    Code HTML4Strict:
    <a href="events.html"><img src="images/menu/events.jpg" alt="Events"></a>
    Also note that you must use '/' characters in the URI, not '\', even if the server is running Windows.
    Birnam wood is come to Dunsinane

  11. #11
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Thanks Tommy, the sample code has been updated so that anyone copying it won't be mislead.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  12. #12
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Birnam wood is come to Dunsinane


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
  •