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 12 of 12
  1. #1
    Regular Coder
    Join Date
    Nov 2008
    Posts
    175
    Thanks
    4
    Thanked 6 Times in 6 Posts

    Validation errors

    I'm helping a friend validate his page and got down to the last two errors which I can't solve.

    Line 43, Column 316: document type does not allow element "a" here; missing one of "object", "span", "bdo", "applet", "iframe", "tt", "i", "b", "u", "s", "strike", "big", "small", "font", "em", "strong", "dfn", "code", "q", "samp", "kbd", "var", "cite", "abbr", "acronym", "sub", "sup", "label", "ins", "del" start-tag

    Line 43
    Code:
    <!-- Facebook Badge START --><a href="http://www.facebook.com/abintus" title="Peter Dunphy" target="_TOP" style="font-family: &quot;lucida grande&quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;"/>Peter Dunphy</a><br/><a href="http://www.facebook.com/abintus" title="Peter Dunphy" target="_TOP"/><img src="http://badge.facebook.com/badge/585745310.4691.274417441.png" width="120" height="136" alt="alt" style="border: 0px;" /><br/><a href="http://www.facebook.com/facebook-widgets/" title="Make your own badge!" target="_TOP" style="font-family: &quot;lucida grande&quot;,tahoma,verdana,arial,sans-serif; font-size: 11px; font-variant: normal; font-style: normal; font-weight: normal; color: #3B5998; text-decoration: none;"/>Create Your Badge<!-- Facebook Badge END -->

    Line 75, Column 53: required attribute "type" not specified

    Line 75
    Code:
    <script src="http://widgets.twimg.com/j/2/widget.js"></script>

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    First error: Your first anchor tag appears to be both self-closed and used with a closing tag. Double-check that and choose just one way.

    Second error: self-explanatory. What "type" is your script? You need to add type="text/javascript" to the script tag.
    Are you a Help Vampire?

  • #3
    Regular Coder
    Join Date
    Nov 2008
    Posts
    175
    Thanks
    4
    Thanked 6 Times in 6 Posts
    I sorted the second error, but for the first one, what's the two different ways it can be done? Would it be possible to post both options as I'm not sure of them.

    Thanks for the help

  • #4
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Code:
    <a href="somewhere.htm">I'm a link</a>
    <a href="uselesslink.htm" />
    Are you a Help Vampire?

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Also this
    Code:
    font-family: &quot;lucida grande&quot;
    should be this
    Code:
    font-family: 'lucida grande'
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    Regular Coder
    Join Date
    Nov 2008
    Posts
    175
    Thanks
    4
    Thanked 6 Times in 6 Posts
    Hi tomws, I been trying to play with what you said last night but still can't get it right, is there any chance you can show me both ways for the code I posted as the example to see exactly how it's done? Both of your examples have closing tags at the end of the link and then it makes all the code after it not work.
    Thanks for all the help today!
    Josh
    Last edited by j05hr; 11-03-2009 at 11:17 PM.

  • #7
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    The first has a closing tag. The second is self-closed. As far as I know, self-closed links (anchors) are useless. You have more than one self-closed anchor in the code.

    Make it easier on yourself to debug. Break that horribly long line into smaller lines and then re-validate. It should help to target exactly where your problem is.
    Are you a Help Vampire?

  • #8
    Regular Coder
    Join Date
    Nov 2008
    Posts
    175
    Thanks
    4
    Thanked 6 Times in 6 Posts
    It is this closing tag that is causing the problem

    Code:
    text-decoration: none;"/>Peter Dunphy

  • #9
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Remove the slash.
    Are you a Help Vampire?

  • #10
    Regular Coder
    Join Date
    Nov 2008
    Posts
    175
    Thanks
    4
    Thanked 6 Times in 6 Posts
    That's what confuses me and what I did originally and that gives 8 errors instead of 1 and one of the errors is still that closing tag.

  • #11
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Ok, let's try another tack. Here's your code with all tag attributes removed.
    Code:
    <!-- Facebook Badge START -->
    <a/>
    Peter Dunphy
    </a>
    <br/>
    <a/>
    <img/>
    <br/>
    <a/>
    Create Your Badge
    That should make it exceedingly obvious where the problems are:
    Code:
    <!-- Facebook Badge START -->
    <a/> <!-- Look at me.  I'm a useless self-closing anchor. -->
    Peter Dunphy <!-- I'm text just hanging out in the open.  I'll bet I should be an anchor. -->
    </a> <!-- Hey, I'm a closing tag with no associated opening tag. -->
    <br/>
    <a/> <!-- Look at me.  I'm a useless self-closing anchor. -->
    <img/> <!-- I'm an image just hanging out in the open.  I'll bet I should be an anchor. -->
    <br/>
    <a/> <!-- Look at me.  I'm a useless self-closing anchor. -->
    Create Your Badge <!-- I'm text just hanging out in the open.  I'll bet I should be an anchor. -->
    Making some assumptions that you really want some links and working code, I'd do this:
    Code:
    <!-- Facebook Badge START -->
    <a>
    Peter Dunphy
    </a>
    <br/>
    <a>
    <img/>
    </a>
    <br/>
    <a>
    Create Your Badge
    </a>
    If you want a link, the link text/image must be wrapped by anchor tags. That means there must be an open and a close.
    Last edited by tomws; 11-04-2009 at 01:12 AM. Reason: fail: wrong tag at end
    Are you a Help Vampire?

  • #12
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Validation errors

    W3 Consortium has specified a set of rules about how the HTML page should designed. Validating the HTML means sticking to those rules. By validating you will make sure that all the browsers will display the HTML content in more or less the same way (even the browsers that you have not tested your HTML pages on).Since all browsers will keep the specification of W3C in mind while designing the browsers. It is important to validate so that you will not have to change it when new browsers are made.
    PSD to HTML Conversion


  •  

    Posting Permissions

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