Jump to content

Doctype, meta tags, and HTML5


socrates

Recommended Posts

This is a two part question.

 

I have a long-standing site that as it developed (under different webmasters) used various doctype declarations and code (20k+ pages and a real mess by now). Ultimately I found it necessary to learn to do the design and maintenance work myself, but I still haven't quite mastered some of the basics.

 

One area of uncertainty for me is in the use of doctype and what meta tags should be ideally be included within the <head></head> tags that follow.

 

Currently I am using .xhtml 1.0 strict and these are the meta tags in head:

<!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">
<head>
<title></title>
<meta name="keywords" content="" />
<meta name="" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
	<link rel="stylesheet" href="/librarycode/main.css" type="text/css" media="screen, projection" />
<meta name="robots" content="index, follow" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
</head>

 

My first question is - what are the requisite tags that should be included between <head> and </head> when creating a document - i.e., is there a good standard to follow?

 

The second part of my question relates to the future and the use of an HTML5 doctype declaration. I have read a previous post on this subject, but I'm still not entirely clear on the issue.

 

Can I now safely start using <!DOCTYPE html> when creating new pages whilst continuing to use the valid xhtml tags that I am used to with xhtml 1.0 strict? At this stage I would not be using any html5 that isn't currently or widely supported.

Link to comment
Share on other sites

Correction, this is the opening code for my pages:

 

<!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">
<head>
<title></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
	<link rel="stylesheet" href="/librarycode/main.css" type="text/css" media="screen, projection" />
<meta name="robots" content="index, follow" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
</head>

Link to comment
Share on other sites

I haven't done much reading up on the HTML5 issues, but you need to definitely add a title into your <title></title> tags. That's very important for search engines and it's what people see on top of their window.

 

The 'description" is what people see when your site shows up as a search result, so that can be a good spot to post some relevant stuff about your site/company.

 

The keywords used to be important for SEO, but seems to be less so now. Throwing some in won't hurt, not sure if it helps. But I'd at a minimum address the title and description tags.

Link to comment
Share on other sites

Thank you, Andrea. There is actually data in the tags for all my pages - title, description and keywords - I just took it out for this example. What I was really wondering is if there is some sort of standard for which meta tags should be included in the head - for example, some sites are using a language one <meta name="keywords" lang="en" content="whatever" />, but I have never included that. But I assume that I haven't missed anything critical (?).

 

As regards HTML5 doctype, I've done a little reading on the subject and I "think" it is safe enough to use it with xhtml code, but it is all a bit of a minefield for people with little or no technical background. What I believe is the case is that you can use xhtml void(?) tags, like <br />, <hr />, <img />, OR <br>, <hr>, and <img> and both will work equally well. But I may well be wrong.

Link to comment
Share on other sites

As regards HTML5 doctype, I've done a little reading on the subject and I "think" it is safe enough to use it with xhtml code, but it is all a bit of a minefield for people with little or no technical background. What I believe is the case is that you can use xhtml void(?) tags, like <br />, <hr />, <img />, OR <br>, <hr>, and <img> and both will work equally well. But I may well be wrong.

 

That is correct: With HTML5, the XHTML closing slashes are not needed, but acceptable.

Link to comment
Share on other sites

  • 2 months later...

Hello Everyone, I am a newbie here and not that bright. Chances are the questions I am going to ask have been asked upteem times but I am not bright enough to locate them and read through? Hopefully, one of you helpful members and moderators will point me in the right direction.

 

I operate a small basic business and just a ONE MAN BAND. Most (90%) ofmy work come from recomendations, but I want to just set up a basic website with no complications.

Ater reading through the web design tutorials by Steffan, I can work out the html, head, title, body stuff with all the opening and closing metta tags.

 

I just need help in determining what information I need to start the whole thing to get it public, like:

>Doctype, Public, etc?

it's leaving me in a state of confusion, even though Steffan says in his tutorials that it is a 'walk in the park'.

 

Thanks in advance for all your help.

NB: I already have obtained th services of a hosting company in advance of me producing and uploading my site. Wishful thinking I agree, but I am in no rush/hurry to go ''live''.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...