1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XHTML anyone? Help me settle a debate

Discussion in 'Off Topic' started by Adam Howard, May 21, 2011.

  1. Adam Howard

    Adam Howard Well-Known Member

    Maybe someone can settle a debate (argument) for me. (Please & thank you)

    So I've never written an XHMTL document before. I'm use to HTML and a little (small) amount of PHP (mostly HTML).

    For a cover page, I decided I need a little bit of cross code and here is what I came up with -vs- a friends. Mine is smaller & more compact and his is double the size. Both of them validate, but he claims mine is not correct.

    Mine:

    Code:
    <!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" xml:lang="en" lang="en">
    <head>
     <title>SociallyUncensored.eu : The complete idiot's guide to an uncensored world</title> <meta name="Keywords" content="entertainment, news, investments, movies, games reviews, books, politics, technology, advertising, media, computers, programming, legal, automotive, wall street, stocks, investments, mac, pc, art, fitness, video games, cell phones, business"/> <meta name="Description" content="SociallyUncensored.eu offers uncensored political, religious and philosophical discussions and debates. Talk freely about anything"/> <meta name="ROBOTS" content="INDEX, FOLLOW"/> <style type="text/css"> <!-- body { background-color: #000000; background-repeat: repeat-x; } --> </style>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="code/jquery-1.3.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="code/bg.js" type="text/javascript" charset="utf-8"></script>
    <link href="style.css" rel="stylesheet" type="text/css" />
    </head>
    <body> <center> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-18520392-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <a href="/forums"><img src="images/logo.png" alt="Click to Enter" title="Click to Enter" border="0" height="438" width="700"/></a> <p> </p> <p align="center"><font color="#999999" face="Geneva, Arial, Helvetica, sans-serif" size="2"> SociallyUncensored.eu offers uncensored political, religious and philosophical discussions and debates. Talk freely about anything<br /> Copyright &copy; 2011 SociallyUncensored.eu All Rights Reserved</font></p> </center> </body> </html>
    
    His

    Code:
    <!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" xml:lang="en" lang="en">
    <head>
    <title>SociallyUncensored.eu : The complete idiot's guide to an uncensored world</title>
    <meta name="Keywords" content="entertainment, news, investments, movies, games reviews, books, politics, technology, advertising, media, computers, programming, legal, automotive, wall street, stocks, investments, mac, pc, art, fitness, video games, cell phones, business" />
    <meta name="Description" content="SociallyUncensored.eu offers uncensored political, religious and philosophical discussions and debates. Talk freely about anything" />
    <meta name="ROBOTS" content="INDEX, FOLLOW" />
    <style type="text/css">
    /*<![CDATA[*/
     <!-- body { background-color: #000000; background-repeat: repeat-x; } -->
    /*]]>*/
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="code/jquery-1.3.1.min.js" type="text/javascript" charset="utf-8">
    </script>
    <script src="code/bg.js" type="text/javascript" charset="utf-8">
    </script>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    /*<![CDATA[*/
     div.c2 {text-align: center}
     p.c1 {color: #999999; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 80%; text-align: center}
    /*]]>*/
    </style>
    </head>
    <body>
    <div class="c2"><script type="text/javascript">
    //<![CDATA[
     var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-18520392-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
    //]]>
    </script> <a href="/forums"><img src="images/logo.png" alt="Click to Enter" title="Click to Enter" border="0" height="438" width="700" /></a>
    <p class="c1">SociallyUncensored.eu offers uncensored political, religious and philosophical discussions and debates. Talk freely about anything<br />
    Copyright &copy; 2011 SociallyUncensored.eu All Rights Reserved</p>
    </div>
    </body>
    </html>
    
    
    Thoughts?
     
  2. Caelum

    Caelum Well-Known Member

    At a glance, yours seems better, especially considering the lack of inline CSS/extra bloat. If it works & validates, there's nothing wrong with it, though for SEO purposes it may be a good idea to copy over his description/keywords meta data into yours (effect will arguably be minimal, but even then).

    Bottom line, I see nothing wrong with your code, and I do see things wrong with his code.

    EDIT: On the topic of that keyword meta data, may want to tone that down to less keywords, see http://en.wikipedia.org/wiki/Keyword_stuffing
     
    TheVisitors likes this.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Just an FYI, but Google doesn't use keywords.
     
    Darkimmortal likes this.
  4. Caelum

    Caelum Well-Known Member

    True. Still, might be useful for some other search engine. ;)

    But yeah, keywords aren't really something to worry about that much.
     
  5. Adam Howard

    Adam Howard Well-Known Member

    True, but Google isn't the only search page out there such as...

    Bing
    Yahoo
    Ask
    Yandex
    Baidu
    Lycos
    Giga Blast
    Alexa
     
  6. Forsaken

    Forsaken Well-Known Member

    Semantically his code is better.

    Chances are that none of them really pay attention to Keywords any longer due to people filling them with garbage to game the system.
     
    Shelley likes this.
  7. Anthony Parsons

    Anthony Parsons Well-Known Member

    Google don't use meta description for ranking purposes (in case anyone is still holding onto that decade old notion), it only uses it when a better description cannot be automatically obtained from the page text via snippet.

    If you have a good page copywritten specifically to target a keyword, then you should drop the meta description, because you don't want Google using it when you have intentionally stacked a page semantically to drive click throughs from the SERPS. If Google uses your default description fed, that can affect click through in a negative capacity.
     
    Darkimmortal and Jethro like this.
  8. James

    James Well-Known Member

    Why don't you say that both of you are wrong and rewrite it using HTML5? ;)
     
  9. Jethro

    Jethro Well-Known Member

    Or use Frontpage or Word to generate the page, like we were told by a client :censored:
     
    Forsaken and James like this.
  10. Adam Howard

    Adam Howard Well-Known Member

    Would be interesting to see how HTML5 would load, but it's not widely supported (yet).

    Also would require me to learn a few things.
     
  11. Adam Howard

    Adam Howard Well-Known Member

    I liked Frontpage when I was starting.
    Still like a full editor something.
     
  12. Forsaken

    Forsaken Well-Known Member

    Uh...

    Other than older versions of IE HTML5 is pretty widely supported, and with older versions it fallbacks to regular HTML.

    Really nothing to lose by adopting HTML5 now.
     
  13. SilverCircle

    SilverCircle Well-Known Member

    That's a myth.

    All modern browsers will render HTML5 compliant pages just fine. New tags may not be fully supported, but they don't hurt either and there is no rule that forces you to use them anyway. Unless your page relies on new HTML features, it will display just fine on almost any commonly used browser.
     
    Anthony Parsons likes this.
  14. Adam Howard

    Adam Howard Well-Known Member

    I guess the benefit would be not depending on 2 js & 1 css files and having it all load in html

    But I'm not sure if that would be really possible or not. Would also question on the page load.
     
  15. SilverCircle

    SilverCircle Well-Known Member

    The answer is easy.

    If if validates, the code is syntactically correct. Period.

    You can argue over things like semantics and SEO for weeks without reaching a final conclusion, but telling whether a piece of HTML code is correct or not is fairly easy.

    Your code is fine with the exception of the formatting tags and attributes you are using (center, align, border). In HTML5, most of these things are no longer valid, so I wouldn't use them and do all the layout/formatting with CSS.

    A couple of changes, and it's valid HTML5 code.
     
    Anthony Parsons likes this.
  16. Adam Howard

    Adam Howard Well-Known Member

    <---- Needs to learn css :(
     
  17. Jethro

    Jethro Well-Known Member

    Currently in the process. Trick seems to be learning when to use "." when to use "#" and when to swear at IE ;)
     
    Kim and James like this.
  18. Adam Howard

    Adam Howard Well-Known Member

    Screen shot 2010-09-19 at 7.15.42 PM.png

    I really wish it would die a painful death
     
    Anthony Parsons and Kim like this.
  19. TerminalAddict

    TerminalAddict Active Member

    has anyone told you xf uses html5?
    html5 is widely supported :)
     
  20. Caelum

    Caelum Well-Known Member

    I'll just leave this here...
     
    TheVisitors likes this.

Share This Page