Fmdpa Posted August 20, 2010 Share Posted August 20, 2010 What is the best way to begin an HTML document to ensure international compatibility and maximum SEO ranking potential? Here's what I've been using so far: <!DOCTYPE HTML><html><head> <title>Untitled</title><link rel=”Shortcut Icon” href=”favicon.ico”><meta name=”keywords” content=”” /><meta name=”description” content=”” /><link rel=”stylesheet” href=”styles/style.css” /></head><body><div id=”head”></div><div id=”container”></div><!--end container--> <div id=”foot”></div><script src=”scripts/mouseover.js”></script></body></html> I prefer HTML5 not only because of its short DTD, but also (mainly) because of the many new options it offers. As for document structure, I still write with XHTML strictness. Should I add attributes to the HTML tag like lang, etc? Link to comment Share on other sites More sharing options...
jeffman Posted August 20, 2010 Share Posted August 20, 2010 This is all still mysterious for most of us, but I think you gain points if you stick relevant information in ONE <h1> and several <h2> elements. They should clearly and efficiently identify your business, product, services, etc. Style them anyway you like; it's the tag that matters. Link to comment Share on other sites More sharing options...
Fmdpa Posted August 20, 2010 Author Share Posted August 20, 2010 Basically what I'm asking is what attributes and tags should be in every HTML page? should I keep the <meta> tags? Should I add some attributes to the <html> tag like "http-equiv='content' type='text/html' lang='en' ..." ??? I notice that most web programmers have a base HTML document that they start with each time they write a new page. I want to know if I'm missing anything that could cause issues with international users. Are the attributes and tags I referenced deprecated or not recommended, but used anyway by some people out of tradition? Link to comment Share on other sites More sharing options...
jeffman Posted August 20, 2010 Share Posted August 20, 2010 You mention SEO, so that's what I addressed.You may want to specify your charset, even if your server is configured to do that automatically. You never know when you'll want to change hosts, etc., and you would not want to have to update your files. So my template has something like this:<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> Link to comment Share on other sites More sharing options...
Fmdpa Posted August 20, 2010 Author Share Posted August 20, 2010 Can those attributes be placed in either the <head> or <meta> tags? Link to comment Share on other sites More sharing options...
amj Posted August 20, 2010 Share Posted August 20, 2010 If you have a lot of meta tags that you repeat/common from page to page I often write these in from a JavaScript file. This way you will only need to modify the common file a bit like when you change the CSS style. <head> <script src="common.js" type="text/javascript"></script></head> Where common.js could write the many usual bits like characterset etc.As far as SEO I find that even without some of the usual bits (of code) most BOTS will find your site. Best method is to include a link from a site that gets a lot of BOT traffic as BOTS will look at all links on the popular site.See http://www.w3schools.com/js/js_examples.asp for writing JS files. Link to comment Share on other sites More sharing options...
Fmdpa Posted August 20, 2010 Author Share Posted August 20, 2010 I assume that by BOTS, you are referring to search engines, not spam bots? Link to comment Share on other sites More sharing options...
dsonesuk Posted August 20, 2010 Share Posted August 20, 2010 If you have a lot of meta tags that you repeat/common from page to page I often write these in from a JavaScript file. This way you will only need to modify the common file a bit like when you change the CSS style.The problem with that is you are essentially referencing identical tags, which may not be relevant to your current content, which will mean the robots are less likely to index your page, description for example will be listed at google for all pages, which will be treated as duplicate content, which is frowned on and could be banned.check out this topic for more:http://w3schools.invisionzone.com/index.ph...mp;#entry176979 Link to comment Share on other sites More sharing options...
Fmdpa Posted August 20, 2010 Author Share Posted August 20, 2010 That was my thought too about the script file and meta tags. Thanks for the link, I rarely use <h1> tags. I prefer the sizes of the <h2> and <h3> tags. Would it be better to use an <h1> tag for headings and re-size it in the stylesheet? Link to comment Share on other sites More sharing options...
Synook Posted August 20, 2010 Share Posted August 20, 2010 If you have a lot of meta tags that you repeat/common from page to page I often write these in from a JavaScript file.Unfortunately, search engine spiders can't interpret JavaScript. Link to comment Share on other sites More sharing options...
dsonesuk Posted August 20, 2010 Share Posted August 20, 2010 That was my thought too about the script file and meta tags. Thanks for the link, I rarely use <h1> tags. I prefer the sizes of the <h2> and <h3> tags. Would it be better to use an <h1> tag for headings and re-size it in the stylesheet?Yes! you must use h1 that is the primary element they look for in the page, which should be at the top and should use primary keyword within it. If it is too large then using css, is the perfect option, not inline but using external css file preferably. Link to comment Share on other sites More sharing options...
boen_robot Posted August 20, 2010 Share Posted August 20, 2010 The stuff every document should contain is covered by Sitepoint's Minimal (X)HTML document article, plus the HTML5 edition.For a reputable (X)HTML page, I'd also add meta keywords, meta description and link "shortcut icon". Comments go into the "XHTML advertised as HTML" debate... my position is the one with Kevin Yank. Link to comment Share on other sites More sharing options...
jeffman Posted August 20, 2010 Share Posted August 20, 2010 As dsonesuk says, the point of the <h1> element is not the way it looks, but how SE bots understand it. That is why I said you may use CSS to style it anyway you like. No serious designer uses the default CSS values for <h> elements anyway, so this should not be a problem. Link to comment Share on other sites More sharing options...
Fmdpa Posted August 20, 2010 Author Share Posted August 20, 2010 Thanks for all the valuable info, everyone. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.