SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Hybrid View

  1. #1
    SitePoint Zealot BTC's Avatar
    Join Date
    Jul 2010
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question about xmlns

    Which one of these is better for search engine crawlers? Is it better to declare the language?

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    <html xmlns="http://www.w3.org/1999/xhtml">

  2. #2
    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)
    I very much doubt the Engines will care too much but it depends upon what version of XHTML you are using and how you are serving it. Though in your case I'd probably choose the first.

    Basically in Appendix C.7: Use both the lang and xml:lang attributes when specifying the language of an element. The value of the xml:lang attribute takes precedence.

    EDIT: Yes, declaring the language is very good idea. I misread part of your post.

  3. #3
    SitePoint Zealot BTC's Avatar
    Join Date
    Jul 2010
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    I very much doubt the Engines will care too much but it depends upon what version of XHTML you are using and how you are serving it. Though in your case I'd probably choose the first.

    Basically in Appendix C.7: Use both the lang and xml:lang attributes when specifying the language of an element. The value of the xml:lang attribute takes precedence.

    EDIT: Yes, declaring the language is very good idea. I misread part of your post.
    Thank you very much, this information is very helpful!

  4. #4
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    The WCAG guidelines say to include them, so include them.
    http://www.w3.org/TR/WCAG20-TECHS/H57

    Same goes for the Content-Language meta. There's a reason EVERY single one of my websites starts out from this template.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html
    	xmlns="http://www.w3.org/1999/xhtml"
    	lang="en"
    	xml:lang="en"
    ><head>
    
    <meta
    	http-equiv="Content-Type"
    	content="text/html; charset=utf-8"
    />
    
    <meta
    	http-equiv="Content-Language"
    	content="en"
    />
    
    <link
    	type="text/css"
    	rel="stylesheet"
    	href="screen.css"
    	media="screen,projection,tv"
    />
    
    <!--
    
    	Don't forget to implement these later!
    
    <link
    	type="text/css"
    	rel="stylesheet"
    	href="print.css"
    	media="print"
    />
    
    <link
    	type="text/css"
    	rel="stylesheet"
    	href="handheld.css"
    	media="handheld"
    />
    
    -->
    
    <title>
    	$pageTitle - $siteTitle
    </title>
    
    </head><body>
    
    <!--
    	empty tags like SPAN and B below are image sandbags for
    	sliding doors or glider-levin replacement - do not remove!!!
    
    	Horizontal rules and .jumpto menus should be removed by 
    	screen, projection and TV CSS. 
    	
    	HR are present for CSS off users.
    	
    	.jumpTo menus include Title on accesskey elements for Opera
    	and Blazer accesskey menus. 
    -->
    
    <div id="pageWrapper">
    
    	<h1>
    		$siteTitle
    		<span></span>
    	</h1><hr />
    
    	<ol class="jumpto">
    		<li>
    			<a href="#pageWrapper"
    				accesskey="1"
    				rel="nofollow"
    				title="Top of Page"
    			>Top of Page</a>
    		</li><li>
    			<a href="#mainMenu"
    				accesskey="2"
    				rel="nofollow"
    				title="Main Menu"
    			>Main Menu</a>
    		</li><li>
    			<a href="#content"
    				accesskey="3"
    				rel="nofollow"
    				title="Page Content"
    			>Page Content</a>
    		</li><li>
    			<a href="#sideBar"
    				accesskey="4"
    				rel="nofollow"
    				title="Page Extras"
    			>Page Extras</a>
    		</li><li>
    			<a href="#footer"
    				accesskey="9"
    				rel="nofollow"
    				title="Bottom of Page"
    			>Bottom of Page</a>
    		</li>
    	</ol><hr />
    
    	<ul id="mainMenu">
    		<li>
    			<a href="home"
    				accesskey="h"
    				title="Back to Home Page"
    			><b>H</b>ome</a>
    		</li><li>
    			<a href="about"
    				accesskey="a"
    				title="About Us"
    			><b>A</b>bout</a>
    		</li>
    	</ul><hr />
    
    	<div id="contentWrapper"><div id="content">
    		Page Content Here
    	<!-- #content, #contentWrapper --></div><hr /></div>
    
    	<div id="sideBar">
    		Sidebar content here
    	<!-- #sideBar --></div>
    
    	<div id="footer"><hr />
    
    		Footer Content Here
    
    	<!-- #footer --></div><hr />
    
    	<!--
    		second jumpto menu needs no accesskeys since they are
    		already assigned up top, and the only reason we used
    		titles up top was so that accesskeys menus (like in Opera)
    		display useful text instead of the URL.
    	 -->
    
    	<ol class="jumpto">
    		<li>
    			<a href="#pageWrapper"
    				rel="nofollow"
    			>Top of Page</a>
    		</li><li>
    			<a href="#mainMenu"
    				rel="nofollow"
    			>Main Menu</a>
    		</li><li>
    			<a href="#content"
    				rel="nofollow"
    			>Page Content</a>
    		</li><li>
    			<a href="#sideBar"
    				rel="nofollow"
    			>Page Extras</a>
    		</li><li>
    			<a href="#footer"
    				rel="nofollow"
    			>Bottom of Page</a>
    		</li>
    	</ol>
    
    <!-- #pageWrapper --></div>
    
    </body></html>

  5. #5
    SitePoint Zealot BTC's Avatar
    Join Date
    Jul 2010
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deathshadow60 View Post
    The WCAG guidelines say to include them, so include them.
    http://www.w3.org/TR/WCAG20-TECHS/H57

    Same goes for the Content-Language meta. There's a reason EVERY single one of my websites starts out from this template.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html
    	xmlns="http://www.w3.org/1999/xhtml"
    	lang="en"
    	xml:lang="en"
    ><head>
    
    <meta
    	http-equiv="Content-Type"
    	content="text/html; charset=utf-8"
    />
    
    <meta
    	http-equiv="Content-Language"
    	content="en"
    />
    
    <link
    	type="text/css"
    	rel="stylesheet"
    	href="screen.css"
    	media="screen,projection,tv"
    />
    
    <!--
    
    	Don't forget to implement these later!
    
    <link
    	type="text/css"
    	rel="stylesheet"
    	href="print.css"
    	media="print"
    />
    
    <link
    	type="text/css"
    	rel="stylesheet"
    	href="handheld.css"
    	media="handheld"
    />
    
    -->
    
    <title>
    	$pageTitle - $siteTitle
    </title>
    
    </head><body>
    
    <!--
    	empty tags like SPAN and B below are image sandbags for
    	sliding doors or glider-levin replacement - do not remove!!!
    
    	Horizontal rules and .jumpto menus should be removed by 
    	screen, projection and TV CSS. 
    	
    	HR are present for CSS off users.
    	
    	.jumpTo menus include Title on accesskey elements for Opera
    	and Blazer accesskey menus. 
    -->
    
    <div id="pageWrapper">
    
    	<h1>
    		$siteTitle
    		<span></span>
    	</h1><hr />
    
    	<ol class="jumpto">
    		<li>
    			<a href="#pageWrapper"
    				accesskey="1"
    				rel="nofollow"
    				title="Top of Page"
    			>Top of Page</a>
    		</li><li>
    			<a href="#mainMenu"
    				accesskey="2"
    				rel="nofollow"
    				title="Main Menu"
    			>Main Menu</a>
    		</li><li>
    			<a href="#content"
    				accesskey="3"
    				rel="nofollow"
    				title="Page Content"
    			>Page Content</a>
    		</li><li>
    			<a href="#sideBar"
    				accesskey="4"
    				rel="nofollow"
    				title="Page Extras"
    			>Page Extras</a>
    		</li><li>
    			<a href="#footer"
    				accesskey="9"
    				rel="nofollow"
    				title="Bottom of Page"
    			>Bottom of Page</a>
    		</li>
    	</ol><hr />
    
    	<ul id="mainMenu">
    		<li>
    			<a href="home"
    				accesskey="h"
    				title="Back to Home Page"
    			><b>H</b>ome</a>
    		</li><li>
    			<a href="about"
    				accesskey="a"
    				title="About Us"
    			><b>A</b>bout</a>
    		</li>
    	</ul><hr />
    
    	<div id="contentWrapper"><div id="content">
    		Page Content Here
    	<!-- #content, #contentWrapper --></div><hr /></div>
    
    	<div id="sideBar">
    		Sidebar content here
    	<!-- #sideBar --></div>
    
    	<div id="footer"><hr />
    
    		Footer Content Here
    
    	<!-- #footer --></div><hr />
    
    	<!--
    		second jumpto menu needs no accesskeys since they are
    		already assigned up top, and the only reason we used
    		titles up top was so that accesskeys menus (like in Opera)
    		display useful text instead of the URL.
    	 -->
    
    	<ol class="jumpto">
    		<li>
    			<a href="#pageWrapper"
    				rel="nofollow"
    			>Top of Page</a>
    		</li><li>
    			<a href="#mainMenu"
    				rel="nofollow"
    			>Main Menu</a>
    		</li><li>
    			<a href="#content"
    				rel="nofollow"
    			>Page Content</a>
    		</li><li>
    			<a href="#sideBar"
    				rel="nofollow"
    			>Page Extras</a>
    		</li><li>
    			<a href="#footer"
    				rel="nofollow"
    			>Bottom of Page</a>
    		</li>
    	</ol>
    
    <!-- #pageWrapper --></div>
    
    </body></html>
    Thanks for the info, it is of much help!

    While on the subject of meta tags, I have used this one, <meta name="distribution" content="global" />
    Is it necessary or just extra coding?

  6. #6
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BTC View Post
    While on the subject of meta tags, I have used this one, <meta name="distribution" content="global" />
    Is it necessary or just extra coding?
    With meta tags you have to ask "what uses it?"

    I've never even HEARD of "distribution" as a named type, and as such I've never heard of anything that actually would make use of it. Sounds like more of the useless bloated garbage sites like metatags.info want people to add to their page for NO GOOD REASON.

    Since there's not a single piece of software out there that makes the least bit of use of 90% of the trash they promote.

    the two http-equiv= : content-type and content-language
    the two name=: keywords and description

    and MAYBE name="robots" for values that are NOT the default

    Anything else? COMPLETE AND TOTAL WASTE OF TIME.

    Well, unless someone screws up your site by filing an ODP without your permission... then the 'noodp' googlebot one might be useful.

    But Author? Generator? Rating? Trash, don't even waste your time.

  7. #7
    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)
    It is extra. Usually character encoding and language types are the main ones you are likely to want to use in most pages as in Jason's example.

  8. #8
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmmm...

    "Dear ds60,

    It's been a long time since our </li><li> argument. I'm happy to find you're agreeing with me, finally.

    If you can't remember, and I'm sure it's hard since it was so long ago, when we were young, oh, so young, let me point you to exactly there: http://www.sitepoint.com/forums/showthread.php?t=708177.

    I wish you well,
    noonnope"

  9. #9
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by noonnope View Post
    "Dear ds60,

    It's been a long time since our </li><li> argument. I'm happy to find you're agreeing with me, finally.
    That formatting is NOT to collapse the white-space, and in fact the whitespace due to the use of ANCHORS will expand between the elements. It is NOT done for the reason of that discussion and I still say that the formatting of the markup one way or the other should have ZERO impact on appearance -- because appearance has no business being in the HTML in the first place. If changing the formatting of the markup screws up the rendering, then there's something fatally flawed with the CSS.

    Nowhere did I say I'd never format LI that way, I just said I'd never format LI that way for the sole purpose of eliminating white-space. I most certainly will add tons of extra carraige returns and tabs if it means I don't have to scroll sideways or look at the illegible MESS that wordwrap ends up. See why the dips who put their CSS on one giant endless line of mush annoy me no end alongside the people who waste their time (and everyone else's) on whitespace stripping.


  10. #10
    Non-Member
    Join Date
    Jun 2010
    Location
    4727′35″N 2618′0″E
    Posts
    1,789
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    Still, I caught you a bit there!

    Because you were judging me for </li><li> and extrapolate from there. But I could say, like you do now, that that's my formatting decision, and my decision also helps in some other areas. You know, like with eating celery


    And no, if "changing the formatting of the markup screws up the rendering" then there is something wrong with UA rendering. Which was the case in the first place. The "chaining" was for correcting a fault, it wasn't aimed at achieving a fraudulent presentational result.


Tags for this Thread

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
  •