SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 33
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    shorttag validation error

    Finally working on validating my site and doing fine apart from one annoying error that I can't get rid of.

    I've inserted the "google plus one button" which gives the following error.

    Line 135, Column 12: element "G:PLUSONE" undefined
    <g: plusone></g: plusone><br><br></center>


    This is the doctype:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    Many thanks in advance.

    ps
    I inserted the spaces after the g: because it shows the "greenman" if I don't.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Code like that is designed to work properly even if it doesn't validate, so I wouldn't worry about it. The only way to remove that error is to remove the code. Remember that validation is there to warn you of potential problems. This won't be a problem.

    It would be better to ditch the transitional doctype, though. That's really for 1990s sites.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Code like that is designed to work properly even if it doesn't validate, so I wouldn't worry about it. The only way to remove that error is to remove the code. Remember that validation is there to warn you of potential problems. This won't be a problem.
    It does work fine. The purpose of the exercise to get rid of as many errors as possible, is to speed up the downloads ( people are impatient, and it appears to be a ranking factor for Google ) and the rumour that Google ranks a site better that is has no ( or few ) code errors.
    Is there some truth in this?

    Quote Originally Posted by ralph.m View Post
    It would be better to ditch the transitional doctype, though. That's really for 1990s sites.
    Is there a practical reason like better serp ranking? I am not a star programmer by any stretch of the imagination and learning whilst keeping up a full time job. I don't mind if the old style limits the options; my site will be kept rather plain by choice.
    Thanks for your quick response.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by benbob View Post
    rumour that Google ranks a site better that is has no ( or few ) code errors.
    Is there some truth in this?
    I'm not sure about that, but I doubt it.


    Is there a practical reason like better serp ranking?
    I don't think so, but an old doctype signals that the site may be built with outdated coding practices, such as tables for layout, which I do believe affects Google ranking a bit. It would be worth switching to a strict doctype and see what errors you get then. That would be very instructive.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  5. #5
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by benbob View Post
    It does work fine. The purpose of the exercise to get rid of as many errors as possible, is to speed up the downloads ( people are impatient, and it appears to be a ranking factor for Google ) and the rumour that Google ranks a site better that is has no ( or few ) code errors.
    Is there some truth in this?
    I've never seen anything to indicate Google is arbitrarily penalising sites that have invalid code. Their goal is to give searchers the most relevant results, and dropping sites because they have technical errors in their code isn't going to fulfil that goal. (Besides, it would be more than a little hypocritical if they did!)

    That doesn't mean that code errors won't harm your search position though. The key word above is 'arbitrarily'. Google reads your code, and uses that to find out what your page is about and determine how and where it should rank. If your code is scrappy and all over the place, riddled with mistakes, there's a fair risk that Google won't be able to understand it properly, and that will harm your search position.

    The main reason for caring about validation (apart from your own professional high standards, of course) is that sites with invalid code are much more likely to display incorrectly on some or all browsers. It might look fine in one browser and be wrong in another. That browser that it looks wrong in might not even be out yet – you can test it in every browser available today and it's fine, then tomorrow a new version of (whatever) is launched and it chokes on your errors. It's much easier to check the code is valid than to test it in every version of every browser!

    On the other hand, proprietary code, whether it's -moz- prefixes in the CSS or Google/Facebook code in the HTML, is always designed to use 'new' tags that aren't part of any spec. That way, supporting agents will work with them correctly, and all others will just ignore them. So it's no big deal if you have errors resulting from proprietary code, as long as you know why they're there.

  6. #6
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    I don't think so, but an old doctype signals that the site may be built with outdated coding practices, such as tables for layout, which I do believe affects Google ranking a bit. It would be worth switching to a strict doctype and see what errors you get then. That would be very instructive.
    I was going to post this very same thing, without the Google ranking bit. The transitional doctype is used nowadays for two reasons: to "transition" a site from an outdated, table-driven structure to a newer one without loss of functionality (hence it would be strictly temporary), or to "hide" old, obsolete code behind the transitional doctype and give the impression that the site is valid when it really isn't.

  7. #7
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies folks.
    My site is handwritten, I do have editors but don't like what they push out. Is there a tangible advantage to switching to a newer version html? Bear in mind that this is somethig I do on the side and I am not a pro-programmer.

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    There's no big advantage, as such, but your original intention was to sort out any coding errors, so putting a more modern doctype in there would give you a better idea of what needs fixing, if anything. The older doctype just means that the validator will be more lenient on you and flag fewer errors.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  9. #9
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    The older doctype just means that the validator will be more lenient on you and flag fewer errors.
    The current doctype is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    Should I change the "Transitional", the "loose" or both?

  10. #10
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    The "loose" is just for Transitional because it's loose (as in lax) and not strict. Just use the following:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

  11. #11
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    The "loose" is just for Transitional because it's loose (as in lax) and not strict. Just use the following:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    I'd cleaned up a page a couple of days ago, at which point it completely validated. I copied the above doctype into this page, and I got 45 errors. 44 to do with unreconised font definitions/definitions.

    I guess it will have to go back to looose, as I have no idea how to do the font specifications other than using css, of which I know virtually nothing.

  12. #12
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Could you post an example of the code it rejected? It might be very simple to change.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  13. #13
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Below are most if not all of the diffrent types of errors.


    Line 25, Column 76: there is no attribute "ALIGN"
    … <table border="0" cellspacing="0" cellpadding="16" width="700" align="center">

    Line 29, Column 29: there is no attribute "COLOR"
    <h1><font color="navy" size="3">A South London Boiler Engineer who …

    Line 29, Column 41: there is no attribute "SIZE"
    … <h1><font color="navy" size="3">A South London Boiler Engineer who r…


    Line 29, Column 44: element "FONT" undefined
    … <h1><font color="navy" size="3">A South London Boiler Engineer who repa…

    Line 86, Column 41: there is no attribute "CLEAR"
    size=1><br></font><br clear="all"><font

  14. #14
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    OK, yeah, that's very outdated code, so there wouldn't be much point in messing with it to make the validator happy. The validator is really telling you that the page needs to be rewritten entirely. But if you're not up for that, the page isn't going to fall apart any time soon.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  15. #15
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    The validator is really telling you that the page needs to be rewritten entirely.
    Rewritten in what? Html5? Xtml?

    Quote Originally Posted by ralph.m View Post
    ...if you're not up for that...
    It is not a matter of being up for it. More like only so many hours in the day and needing to do first what pays of most including:

    50+ pages to add to the site, 100% inhouse and hand coded.
    Existing 30 pages need improving in lay out, content and seo.
    Upgrading seo skills.
    Adding and maintaining a blog.

    If there is a quantifiable advantage in switching to the next generation coding, I will learn it. If it is a mainly a matter of "programming-aesthetics" and not much else, I'd rather spend the time on upgrading my seo skills as that will put bread on the table.

  16. #16
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by benbob View Post
    Rewritten in what? Html5? Xtml?
    It's not a case of what language it's written in, but writing it in a way that's semantically correct and most efficient.

    As a basic rule, HTML is a language for identifying the meaning. For example, if you use a table, that is signalling that your are dealing with tabular data (related by rows and columns). Anything related to style or layout (Presentation) should be handled by CSS. In the bad old days of HTML, before CSS was properly supported in browsers, hacks such as table layouts and font tags were invented. But they are incredibly inefficient and not very accessible, for a start, so it's better to rewrite a page without them.

    It's a bit like a building that isn't constructed properly. It's better to tear it down and rebuild from the ground up that patch it up and hope for the best.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  17. #17
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I see. How do I go about learning how to do presentation properly?

  18. #18
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,881
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by benbob View Post
    Rewritten in what? Html5? Xtml?
    HTML4 will do fine. At the moment you're using HTML3.2 with some bits of 4 thrown in.

    In HTML4, you're supposed to use CSS for all the presentation, formatting, layout and styling information. So instead of putting <h1><font color="navy" size="3"> in every time you have a heading, you just use the heading <h1> in the HTML, and then you have a CSS file (for the whole site), which includes h1 {color:navy; size:1.3em;}, and that sets the style for all <h1> headings on the site.

    It is not a matter of being up for it. More like only so many hours in the day and needing to do first what pays of most
    I know that feeling well!

    Setting your site up to use CSS will bring you massive time and efficiency savings in the medium and long term, maybe even in the short term as well, particularly if you are hand-coding it. Even if you don't go the whole hog with the layout immediately, it really is worth moving to CSS for formatting as soon as you can.
    Last edited by Stevie D; Aug 23, 2011 at 05:13. Reason: Stuffed up formatting

  19. #19
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    A small addition to what Ralph, Stevie, et al. wrote: If you indeed have 50 pages on the site, which are all hand-coded, switching to a non-table CSS-based layout will literally allow you to reduce the time it takes to re-design the entire website with 98 percent. Once you learn more about CSS, you can improve this even more.

    Another point, which is a bit moot, and only really interesting as a technical curiosity: The syntax g:plusone would actually be valid if you page was written in true XHTML (i.e. sent with an application/xml+xhtml MIME type). All it would require would be to define an XML namespace for the g: prefix. Only problem is, any version of Internet Explorer below 9 would be unable to display the page. Also note that, as I recall, this would not actually validate in the W3 validator, even though it's strictly technically correct, as the W3 validator can't handle user-defined namespaces.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  20. #20
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by benbob View Post
    I see. How do I go about learning how to do presentation properly?
    Basically by finding a good book on CSS, or using similar online resources. SitePoint has some good offerings.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  21. #21
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    HTML4 will do fine. At the moment you're using HTML3.2 with some bits of 4 thrown in.
    And here I am, thinking it was done in 4; just goes to show how little I know. My site was originally done with one of those "diy-packages" involving lots of templates, remote java scripts and more of that nonsense by an "expert". Ditched the expert as well as the package and changed to handcoded. Site is now lots quicker and ranks better.
    $64000 question: how do I change the current hybrid to proper HTML4?

    Quote Originally Posted by Stevie D View Post
    In HTML4, you're supposed to use CSS for all the presentation, formatting, layout and styling information.
    Setting your site up to use CSS will bring you massive time and efficiency savings ... it really is worth moving to CSS for formatting as soon as you can.
    I can move to CSS formatting as soon as I have an idea about what the quickest way of learning it is. Anything decent ( practical ) online available?
    I am a quick study for most things that are presented in a style that suits me, but hopeless if the presentation does not appeal to me. That eliminates anything involving money before I can see if I like it or not.

  22. #22
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Home - Build Your Own Website The Right Way Using HTML & CSS, 3rd Edition is an excellent place to begin. It's not free, but it's well worth the money.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  23. #23
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    Home - Build Your Own Website The Right Way Using HTML & CSS, 3rd Edition is an excellent place to begin. It's not free, but it's well worth the money.
    The problem with buying books before seeing them, is that they end up gathering dust if the presentation doesn't appeal to me. It's not a matter of being simple or complicated, but purely like it or don't.

  24. #24
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Basically by finding a good book on CSS, or using similar online resources. SitePoint has some good offerings.
    LOL. Guess I should have phrased it as: Anything available online that comes recommended along the lines of public domain/freeware that allows me to have a taste?

  25. #25
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,114
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    You can download free sample chapters of each SP book. That should give you a good taste of whether it's for you or not.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


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
  •