SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: Not validating

  1. #1
    SitePoint Member
    Join Date
    Apr 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Not validating

    Ok I am using the old <link rel="> to define my css file but I find in xhtml it doesnt validate?!?! anyone know how to fix this?

    http://home.cfl.rr.com/phire/test/index.htm

    TIA

    Phire

  2. #2
    SitePoint Addict psychedelic's Avatar
    Join Date
    Feb 2002
    Location
    Boston
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you have:

    Code:
    <link rel="stylesheet" href="test.css" type="text/css"></link>
    shoudl be:

    Code:
    <link rel="stylesheet" href="test.css" type="text/css" />
    <link> is what you call an "empty tag" which means it has no closing equivlent i.e. "</link>" Another example of an "emtpy tag" that requires a forward slash before the ending carat (>) would be <br> and <img>, both which need to look like <br /> and <img ... /> respectively.

    Have fun,
    The Internet is prettier on a Mac.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You shouldn't have a closing </link> tag.
    All you need to do is add a slash at the end of the link tag:

    <link rel="stylesheet" href="test.css" type="text/css" />

  4. #4
    SitePoint Member
    Join Date
    Apr 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm it validates that way?


    Thanks!

  5. #5
    SitePoint Member
    Join Date
    Apr 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still doesnt do it for me

    Line 12, column 10:
    <link rel=stylesheet href="test.css" type="text/css" />
    ^
    Error: attribute values must be quoted in XML

    Line 12, column 54:
    <link rel=stylesheet href="test.css" type="text/css" />
    ^
    Error: element "link" not allowed here; check which elements this element may be contained within

    Line 43, column 50:
    ... c="/images/test.gif" width="160" height="120" ALT="test" border="0" /> ...
    ^
    Error: there is no attribute "ALT" for this element (in this HTML version)

    Line 43, column 50:
    ... " width="160" height="120" ALT="test" border="0" /></a></div>
    ^
    Error: required attribute "alt" not specified




    Sorry, this document does not validate as XHTML 1.0 Transitional.

    If you use CSS in your document, you should also check it for validity using the W3C CSS Validation Service.


    --------------------------------------------------------------------------------

    Source Listing
    Below is the source input I used for this validation:

    1: <!-- saved from url=(0022)http://internet.e-mail -->
    2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    3: "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
    4:
    5: <html xmlns="http://www.w3.org/1999/xhtml">
    6:
    7: <head>
    8: <title>Home</title>
    9: </head>
    10:
    11: <body>
    12: <link rel=stylesheet href="test.css" type="text/css" />
    13:
    14: <!--Top box-->
    15:
    16: <div class="toplogo">Main logo</div>
    17: <br /><br /><br />
    18:
    19: <!--Left Box-->
    20:
    21: <div class="leftnav">Left Navigation<br />
    22: <!--I figured I would used a nested paragraph instead of the 'ole hard space (&nbsp since I could just set margins inside the paragraph instead of having a 1/2 dozen spaces-->
    23: <p class="links">
    24: <a href="about.htm" class="links">About</a><br />
    25: <a href="tour.htm" class="links">Tour</a><br />
    26: <a href="location.htm" class="links">Location</a><br />
    27: <a href="scheduling.htm" class="links">Scheduling</a><br />
    28: <a href="programs.htm" class="links">Programs</a><br />
    29: <a href="course.htm" class="links">Challenge Course</a><br />
    30: <a href="links.htm" class="links">Links</a><br />
    31: <a href="donor.htm" class="links">Donor Opportunities</a><br /><br />
    32: </p>
    33: </div>
    34:
    35: <!-- The Right Box-->
    36:
    37: <div class="rightlogo">Right Graphic</div>
    38:
    39:
    40: <!--Main area, including your thumbnail-->
    41:
    42: <div class="news">Boring Thumbnail for you ) <br /><br />
    43: <a href="/images/testbig.gif" ><img src="/images/test.gif" width="160" height="120" ALT="test" border="0" /></a></div>
    44:
    45: </body>
    46:
    47:
    48: </html>

  6. #6
    SitePoint Wizard iTec's Avatar
    Join Date
    May 2001
    Location
    Sydney, Australia
    Posts
    2,243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your <link> tag needs to be between your <head> tags, not your body tags.

    and line 43 you have alt in uppercase, it has to be in lowercase to validate.

  7. #7
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Phire
    Still doesnt do it for me

    Line 12, column 10:
    <link rel=stylesheet href="test.css" type="text/css" />
    ^
    Error: attribute values must be quoted in XML

    Line 12, column 54:
    <link rel=stylesheet href="test.css" type="text/css" />
    ^
    Error: element "link" not allowed here; check which elements this element may be contained within
    In English that means you forgot the quotes around the word "stylesheet" and the link tag should be in the head, not the body.

    <link rel="stylesheet" href="test.css" type="text/css" />

  8. #8
    SitePoint Member
    Join Date
    Apr 2002
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No errors found! *




    Thanks guys!


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
  •