SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict sdamos's Avatar
    Join Date
    Sep 2003
    Location
    Arizona
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    W3C Compliance Question

    Greetings all,

    I am starting a template at http://www.donmattingly.com/test/

    However, if you click my validation for W3C at the botton, for XHTML, I have an affiliate link that is driving the validator nuts! Can anyone help me fix this affiliate URL so it still gives me credit, but works with the validator?

    Thanks

  2. #2
    SitePoint Addict sdamos's Avatar
    Join Date
    Sep 2003
    Location
    Arizona
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, I am having trouble reducing the area BELOW my mailing list form. There is a gap there between the form and the header that is bothering me. Any help would be appreciated, thanks.

  3. #3
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,222
    Mentioned
    237 Post(s)
    Tagged
    1 Thread(s)
    First thing, if you are coding in XHML, you really need to tell that to the browser.

    So your DOCTYPE will be something like:

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    and no the one you have. Why? Because with your doctype, you are treating the document as if it was HTML, although, funny enough, you want to validate it as XHML. The thing is.... XHTML IS NOT HTML, it is XML using the tags and structure of HTML, which is something quite different. And therefore, XHTML needs a XML heading, not an HTML one like you have.

    XHTML is a "simpler" XML that will help you to do the transition from HTML to XML, to learn the new rules using something you are familiar with. Also, XHTML is useful because browsers do not support XML as they should.

    Secondly, you use the TITLE tag as if it was a keyword META. I am quite sure that you do it for the sake of search engines, but it is quite annoying and I am not very sure that works.

    Thirdly, you are not consistent with XHTML. Empty tags should be closed with /> to indicate that they are not part of a pair. Example:

    Code:
    <meta name="author" CONTENT="Shannon Amos" />
    It needs to be like that, you need the white space between the "Shannon Amos" and the />. Most of your metas do not have this.

    Also, XHMTL is case sensitive so it does not recognise CONTENT, but it will recongnise content. Everything needs to go in lower case.

    XHTML requires that every attribute value goes is quoted. Example:

    Code:
    <form action="http://www.donmattingly.com/cgi-bin/dada/mail.cgi" target="_blank" method="post">
    (see the lower case and the quotes?) and no

    Code:
    <form action="http://www.donmattingly.com/cgi-bin/dada/mail.cgi" target="_blank" method=POST>
    Again, all your input tags (which are what in XML are known empty tags), do not have the /> ending required.

    And, about your link. Well, it works because that is something that the browser knows how to parse, and since you do not have your <?xml ....?> tag, the browser parses everything as simple, well known HTML. But you are using an XHTML validator, even if your document is not. And why does it not validate?it does not validates because in XHTML (and XML), the & indicates the beggining of an entity, so when you want an & to act as such, you need to write its entity instead, even in an URL.

    Note: an entity is a name for chunks of text. So, if you suspect that you are going to write the same paragraph a few times, and you do not want to type it again and again, you create an alias and write the alias (entity) in the document instead. The XML parser substitutes the alias/entity with the chunk of text. All entities, when included in an XML document, begin with &.

    so your link should be:
    Code:
     <a href="http://www.everyticket.com/mlb/new_york_yankees_tickets.html?img=11&amp;kbid=22737" target="_blank">Tickets</a>
    Be aware that this link, like this, will only work if the document is XHTML, but it will not work if it is HTML.


    So basically, what happens is that you are using an XHTML validator and the validator complains because, if your document was really XHTML, the link would not work. XHTML would think that you are naming an entity where the & is. But your link works because your document is not XHTML.

    now, if you use an HTML validator, I am quite sure that the number of erros would be related to the empty tags you did close with />.

    So now, you have to decide... do you want an XHTML document, or an HTML one? And then, code accordingly

    Hope this helps.

  4. #4
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,222
    Mentioned
    237 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by sdamos
    Also, I am having trouble reducing the area BELOW my mailing list form. There is a gap there between the form and the header that is bothering me. Any help would be appreciated, thanks.

    For me, it looks fine. But do it with CSS. Reduce the padding & margins of the input element, as an example. If not enough, do it with the TABLE element as well. But I do not think that it looks bad.

  5. #5
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    form {
    margin: 0px;
    padding: 0px;}

    should remove the default margins and padding cross browser.

    Nadia

  6. #6
    SitePoint Addict sdamos's Avatar
    Join Date
    Sep 2003
    Location
    Arizona
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks all


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
  •