SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2003
    Location
    scarborough
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Full xhtml compatability and google

    I have been told that my site would increase its position on google if it was fully xhtml compliant. There are two things here

    1. Special characters. I have got confused a bit over special characters. Many pages include quotations. like this "quote" instead of "

    what special characters can be used. Which ones should you use. maybe these is it.

    ’ which is '
    “ left quote
    ” right quote
    " quotation

    2. use of the quotes in html eg

    <href="thispage.html">

    Is it absolutely essential that you do not mix these. I was told that you can use ' or " but not mix them.

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I sincerely doubt that XHTML compliance matters to Google. I don't even know if Googlebot handles XHTML. (It does handle pretend-XHTML, of course.)

    Enclosing attribute values in quotation marks or apostrophes is a good practice anyway, even for HTML.

    The only time you need to use the &quot; entity reference is inside an attribute value surrounded by quotation marks,
    Code HTML4Strict:
    <img src="car.jpg" alt="My &quot;new&quot; car">

    Most of the time it's easier to just use apostrophes around the value instead,
    Code HTML4Strict:
    <img src="car.jpg" alt='My &quot;new&quot; car'>
    I don't know who told you you can't mix the two types. It's utterly ridiculous.

    You may need to escape an apostrophy for the same reason. In real XHTML you can use the &apos; entity reference. In HTML (including pretend-XHTML) you need to use a numeric character reference instead: &#39;.

    There is no reason whatsoever to escape quotation marks or apostrophes in your body text, only in attribute values.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I don't know who told you you can't mix the two types. It's utterly ridiculous.
    That likely came from a "Don't write sloppy code" site where someone was doing this:
    <input type="submit' name='foo" id=`bar`/>

    I've actually seen the last one on a page. While it's only irritating to see ` used as an apostrophe, it's very strange in HTML.

    I have been told that my site would increase its position on google if it was fully xhtml compliant.
    While teh googlies have been crawling through the wasteland known as Tag Soup for years and continue to rank pages just fine, the suggestion might have meant more that better, leaner, valid code may present less garbage in front of your content, which might even matter to a googliebot if your page is very very long. Apparently bots may start to index a page and then stop for some reason, so you'd want them to get as much as possible, as easily as possible. However, plenty of crapola garbage nested-tables-n-font-tags sites rank just fine. Because teh googlies rank CONTENT which even trumps code. People aren't searching teh googles for codez. They're searching for ch33p v1agra and pr0n and how to get rich quick and find the One True God and all that.

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    While it's only irritating to see ` used as an apostrophe, it's very strange in HTML.
    It's also utterly invalid. My guess is that browsers will interpret id=`bar` as id="`bar`", which is still invalid (an ID must start wtih a letter).
    Birnam wood is come to Dunsinane


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
  •