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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New Coder
    Join Date
    Jun 2010
    Location
    Hampshire, England
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Text dissapears when i add an <a href> link

    Hi guys, im having a problem which i have tried to solve myself for the past two hours but cant figure it out, ive only just started with html so im sorry if its a dumb question, anyway here goes the code below is what i am using

    <?xml version= "1.0"ecoding = "UTF - 8"?>
    <DOCTYPE html PUBLIC "- //WC3//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns = "http://www.w3.org/1999/xhtml " xml:lang="en">

    <head>
    <title> The Shop </title>
    </head>

    <body style="background-color:#00cc00;>

    <h1> Welcome To The Shop </h1>
    <p>
    bla bla bla text.
    </p>

    <a href="shop.htm"> Shop </a>

    <a href=http://www.shop.com> The world's Largest shop </a>

    </body>


    </html>

    when it is like it is above i can see the main body text, but whenever i add another link like the code below you cant see the second link, can any1 please help?

    <?xml version= "1.0"ecoding = "UTF - 8"?>
    <DOCTYPE html PUBLIC "- //WC3//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns = "http://www.w3.org/1999/xhtml " xml:lang="en">

    <head>
    <title> The Shop </title>
    </head>

    <body style="background-color:#00cc00;>

    <h1> Welcome To The Shop </h1>
    <p>
    bla bla bla text
    </p>

    <a href="shop.htm"> the Shop </a>

    <a href=http://www.shop.com> the shop </a>

    </body>








    </html>
    Last edited by webnewb; 06-29-2010 at 03:15 PM.

  • #2
    Regular Coder
    Join Date
    Jan 2009
    Posts
    193
    Thanks
    0
    Thanked 20 Times in 20 Posts
    For one thing your body style does not have a closing double quote and your "the shop" link does not have double quotes around the href="".

  • #3
    New Coder
    Join Date
    Jun 2010
    Location
    Hampshire, England
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    updated those

    thanks skywalker updated those but issue still exisits, any suggestions?

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Use HTML Doctype and notation, not XHTML. XHTML was made to handle XML objects within HTML, which I doubt it is your case, and it has some strict rules. HTML 4.01 is enough.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    New Coder
    Join Date
    Jun 2010
    Location
    Hampshire, England
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Kor

    Hi Kor,

    Thanks for your help, but what exactly does

    Use HTML Doctype and notation, not XHTML. XHTML was made to handle XML objects within HTML, which I doubt it is your case, and it has some strict rules. HTML 4.01 is enough.
    mean? does it mean change the coding at the top just to say <html>? rather than all the xml stuff? if so do i delete all the xml stuff as i got it out of sams teach yourself html and css in 24 hours book.

    thanks again for helping

  • #6
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #7
    New Coder
    Join Date
    Jun 2010
    Location
    Hampshire, England
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts
    heres the new and updated code, still the link to the 'pokershop' doesnt work, sorry to keep bothering you and thanks for the help so far, can you see why it isnt showing up? p.s ive tried shortening the link to pokershop.htm as its in the same folder but it still doesnt work

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <head>
    <title> The One Stop Poker Shop </title>
    </head>

    <body style="background-color:#00cc00;">

    <h1> Welcome To The One Stop Poker Shop </h1>
    <p>
    The One Stop Poker Shop is the largest private poker network.
    We supply top of the range poker accessories for that tournament
    poker experience in your own home. Whether your playing a home
    game vs a mate or two or playing a home game vs a group of individuals
    the best way to impress them is with professional poker accessories and
    we've got it all lined up for you in our poker shop! Click below to check out our amazing range
    of poker goodies from top of the range poker tables to top of the range card shufflers!
    </p>

    <a href="C:\Users\Dan and Ash\Desktop\Sams HTML and CSS\pokershop"> Poker Shop </a>

    <a href="http://www.pokerstars.com"> The world's Largest Online Poker Network </a>

    </body>


    </html>
    Last edited by webnewb; 06-29-2010 at 04:56 PM.

  • #8
    Regular Coder jfreak53's Avatar
    Join Date
    May 2004
    Location
    Guatemala
    Posts
    477
    Thanks
    19
    Thanked 10 Times in 10 Posts
    Two things, one put a <br> in between the link to new line it.

    Second if your using a local file on windows run it like this:
    Code:
    <a href="file:///C:/Users/Dan and Ash/Desktop/Sams HTML and CSS/pokershop"> Poker Shop </a>
    "FORTRAN is not a language. It's a way of turning a multi-million dollar mainframe, into a $50 programmable scientific calculator."
    http://www.microfastcat.com -- FastCat Software, the fastest software on the NET!
    http://www.microthosting.com -- Free reseller web hosting, Hosting, VPS, FREE SMALL HOSTING!!!
    http://www.microtronix-tech.com -- Web design and programming

  • #9
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Two things:
    1) Why are you using a Transitional DTD? This is a new document. You should only ever use Strict.
    2) Why do you keep putting spaces between tags and text? It's weird.

    Actually I have a couple more:
    3) You shouldn't really use inline CSS. It really defeats the whole point in it. Use a style block in development if you really like all your code on one page, but you should move it to an external stylesheet before putting it live.
    4) If you can, use a relative path. This means you don't have to update all your links when you post your pages online. In the end, it's a lot cleaner. What jfreak gave you may actually work, but spaces are invalid in URIs.

  • Users who have thanked Apostropartheid for this post:

    webnewb (06-30-2010)

  • #10
    New Coder
    Join Date
    Jun 2010
    Location
    Hampshire, England
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Hi Apost

    Hi apost, thanks for your feedback here are the answers to your questions,


    1) Why are you using a Transitional DTD? This is a new document. You should only ever use Strict.
    Im using transitional DTD because im not sure of the excaxt document type i should be using, could you show me the exact code i should put at the head of each document? i was using the latest xhtml document type as sams teach yourself css and html in 24 hours said to do so but others have told me not to, what should i actually be doing?



    2) Why do you keep putting spaces between tags and text? It's weird.
    The book told me to keep things 'spacey' to make it easier to read, but i wont from now on if its wierd lol. sorry didnt realise it was wrong.

    3) You shouldn't really use inline CSS. It really defeats the whole point in it. Use a style block in development if you really like all your code on one page, but you should move it to an external stylesheet before putting it live.
    Could you please tell me what inline css is? are there more than one type of css? i have no idea, if thats a stupid question im sorry

    4) If you can, use a relative path. This means you don't have to update all your links when you post your pages online. In the end, it's a lot cleaner. What jfreak gave you may actually work, but spaces are invalid in URIs.
    I will try to use relative paths where possible,

    thanks for all your input i really do appreciate it

  • #11
    Regular Coder jfreak53's Avatar
    Join Date
    May 2004
    Location
    Guatemala
    Posts
    477
    Thanks
    19
    Thanked 10 Times in 10 Posts
    Doctype:
    http://www.w3schools.com/tags/tag_DOCTYPE.asp

    The book told me to keep things 'spacey' to make it easier to read, but i wont from now on if its wierd lol. sorry didnt realise it was wrong.
    By spacy it meant correct programming spaces not space between tags and content, like this:

    Code:
    <html>
      <head>
        <title>MyTitle</title>
      </head>
    
      <body>
        <p>Text</p>
      </body
    </html>
    Basically correctly formated code spacing.

    First off learn correct CSS placement and the way to correct write, either here:

    http://www.tizag.com/cssT/index.php

    Or the W3:

    http://www.w3schools.com/css/

    By style block apos was talking about this:

    Code:
    <html>
    <head>
    <style type="text/css">
    
    p {color: white; }
    body {background-color: black; }
    </style>
    </head>
    It's a style block for everything inside the head tag of your document. But even that defeats the purpose and I think apos would agree with me use external, that way it can be once written for multiple pages:

    Code:
    <head>
    <link rel="stylesheet" type="text/css" href="test.css" />
    </head>
    And I didn't get into the relative path thing because I kind of thought it was mute since he was using a Windows directory path on a windows machine, I didn't really think he was going to run it like that publicly, I think I might have been wrong.

    Yes always relative or if you can run it with the http url, but never use the local directory path, ever. And yes spaces are invalid, that's why you see a lot of url's with "%20" in them. But again thought it might be mute since the way he was running it anyways.

    I go over this time and time again with clients who upload pictures, why can't I have spaces and the wierd names I call my pictures, ha ha, it's fun ha ha.
    "FORTRAN is not a language. It's a way of turning a multi-million dollar mainframe, into a $50 programmable scientific calculator."
    http://www.microfastcat.com -- FastCat Software, the fastest software on the NET!
    http://www.microthosting.com -- Free reseller web hosting, Hosting, VPS, FREE SMALL HOSTING!!!
    http://www.microtronix-tech.com -- Web design and programming

  • Users who have thanked jfreak53 for this post:

    webnewb (06-30-2010)

  • #12
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    You should use only XHTML 1.0 Strict or HTML 4.01 Strict DOCTYPES (go with the first here.)

    Also, jfreak (offtopic), the word you're looking for is "moot" :P

  • #13
    New Coder
    Join Date
    Jun 2010
    Location
    Hampshire, England
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts
    thanks jfreak that post helped alot, im using the links you have supplied now in an attempt to get a better grasp on things, i've thanked you officially through the 'thank user' button.

    Also jfreak, would you mind swapping emails as i have found your advice very helpful and i could possibly email you with future questions should i have any? If so my email is dj.cassidy@yahoo.com

    Many thanks again

  • #14
    New Coder
    Join Date
    Jun 2010
    Location
    Hampshire, England
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Hi Apost

    Hi apost,

    is this the doctype you reccomend i use?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    thanks
    Last edited by webnewb; 06-30-2010 at 03:18 PM.

  • #15
    Regular Coder jfreak53's Avatar
    Join Date
    May 2004
    Location
    Guatemala
    Posts
    477
    Thanks
    19
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by Apostropartheid View Post
    Also, jfreak (offtopic), the word you're looking for is "moot" :P
    Ha ha ha ha thank you I was scratching my head trying to remember how to spell that stupid word!! ha ha, it was early what do you expect
    "FORTRAN is not a language. It's a way of turning a multi-million dollar mainframe, into a $50 programmable scientific calculator."
    http://www.microfastcat.com -- FastCat Software, the fastest software on the NET!
    http://www.microthosting.com -- Free reseller web hosting, Hosting, VPS, FREE SMALL HOSTING!!!
    http://www.microtronix-tech.com -- Web design and programming


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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