homepage Welcome to WebmasterWorld Guest from 54.224.202.109
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Meta Tags & DOCTYPE?
Meta Tags & DOCTYPE?
sderenzi




msg:573522
 9:57 am on Mar 24, 2004 (gmt 0)

1. I'm currently using Flash/HTML/CSS in my webpage design. I am wondering whether <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> is a proper DOCTYPE to be using?

2. I currently use the following Meta Tags in my index.htm:

<meta http-equiv="content-type" content="css/html/text; charset=iso-8859-1">
<meta name="abstract" content="word1,word2,word3,word4">
<meta name="author" content="name">
<meta name="copyright" content="example.com (C)opyright 2004 All Rights Reserved">
<meta name="date" content="2004">
<meta name="description" content="word1,word2,word3,word4">
<meta name="distribution" content="global">
<meta name="keywords" content="word1, word2, word3, word4">
<meta name="language" content="english">
<meta name="mssmarttagspreventparsing" content="true">
<meta name="publisher" content="www.example.com">
<meta name="rating" content="general">
<meta name="reply-to" content="samderenzis@example.com">
<meta name="revisit-after" content="10 days">
<meta name="robots" content="all,index,follow">
<meta name="title" content="title name">

I wanted to know if I've made any mistakes in them, but also should I use them on each HTML page or not, you see my site is framed?

[edited by: tedster at 11:12 am (utc) on Mar. 24, 2004]
[edit reason] remove specifics [/edit]

 

tedster




msg:573523
 11:11 am on Mar 24, 2004 (gmt 0)

Welcome to the forums, sderenzi.

Yes, a transitional HTML 4.01 doctype seems fine for your purposes. I'd suggest you use a full doctype, however, like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Notice that it includes the W3C URL - this will ensure that Explorer 6 displays in standards mode.

As for the meta tags - most of them have little use as far as search engines, although you may want to place them there for other reasons (finctions internal to your site, or to declare your ownership very clearly).

As for the specific the meta tags, here are some comments:

1. abstract, author, copyright, date
These are not read by search engines. I would save the files size and not use them, unless you have solid need for some reasons.

2. description
Many times, this tag will show up below your title on search engine results. You probably want full sentences, and not a list of words and phrases here.

3. distribution
Again, not read by the SEs, and not commonly used.

4. keywords
Barely used by major search engines, but fine to include. Just don't agonize over it. I notice that you separated your words with both a comma and a space. Use just one or the other - no need to waste file size.

5. language
Not really needed. Your DTD and charset meta tag handle it just fine.

6. mssmarttagspreventparsing
OK, if you have some concern that MS Smart Tags will ever be an issue. It looks like MS backed off on these plans because of the uproar they caused, so I don't worry with this one either.

7. publisher, rating, reply-to
I also think these are a waste of bandwidth.

8. revisit-after
Unless you use a third party search engine (for your own internal search for instance) that uses this tag, it's of no use. Major search engines ignore it.

9. <meta name="robots" content="all,index,follow">
The correct syntax is simply "index,follow". However, if that is the behavior you want (index the page and follow the links), that's what robots will already do by default - so no meta tag is needed. So I'd only use this if you want some combination of noindex or nofollow for a particular page.

10. title
Definitely don't bother. But DO begin your head section with an HTML <title></title> element, preferably right after your DTD.

IN years gone by, when search engines were very crude, text-match affairs, putting a long list of meta information in the head "may" have helped a bit in some cases. It does nothing for you today, however.

One more comment - you asked about the frames on your site and the DTD. The HTML 4.01 frameset DTD is only needed if you are writing STRICT html, as far as I know. But with transitional code your chosen DTD is fine for a page, with or without frames.

<edit>I was completely wrong in the above statement - the frameset doctype IS what you need for any HTML 4 frameset page. My apology to anyone I misled.</edit>

The W3C's list of full DTD's is here:
[w3.org...]

[edited by: tedster at 4:20 pm (utc) on Mar. 27, 2004]

Hagstrom




msg:573524
 12:39 pm on Mar 24, 2004 (gmt 0)

4. keywords Barely used by major search engines, but fine to include. Just don't agonize over it. I notice that you separated your words with both a comma and a space. Use just one or the other - no need to waste file size.

Yahoo! uses the meta-keywords.

5. language
Not really needed. Your DTD and charset meta tag handle it just fine.

Are you saying that the "en" in "Transitional//EN" stands for "English"? I thought I was supposed to use the html-tag: <html lang="en">.

grahamstewart




msg:573525
 12:50 pm on Mar 24, 2004 (gmt 0)

hagstrom: yes, keep using <html lang="en"> - that's how w3c say we should handle language [w3.org]. But the language meta tag is worthless.

sderenzi: your content-type tag is also wrong. It says css/html/text which is not a known MIME type. Instead it should read..

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

and if you use inline CSS then you should also specify:
<meta http-equiv="Content-Style-Type" content="text/css">

tedster




msg:573526
 1:32 pm on Mar 24, 2004 (gmt 0)

if you use inline CSS then you should also specify:
<meta http-equiv="Content-Style-Type" content="text/css">

Wow, I never knew that one - got a reference for my bookmarks?

grahamstewart




msg:573527
 1:38 pm on Mar 24, 2004 (gmt 0)

Sure, it is mentioned in the HTML4 spec here:
[w3.org...]

bumpaw




msg:573528
 2:11 pm on Mar 24, 2004 (gmt 0)

Thanks for all the reference info. This thread is headed for my tips file.

tedster




msg:573529
 4:48 pm on Mar 24, 2004 (gmt 0)

Ah, I see. According to that W3C reference, if the meta declaration isn't there then:

3. Otherwise, the default style sheet language is "text/css".

That's why I haven't been in any trouble by leaving it out. I only use CSS stylesheets.

[edited by: tedster at 1:41 pm (utc) on Mar. 25, 2004]

g1smd




msg:573530
 9:16 pm on Mar 24, 2004 (gmt 0)

This is how I do it (taken from a message I posted a few months ago):

Your document should begin with a !DOCTYPE (tells the browser what sort of HTML is in the file) and starting tags:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>


For your page to actually be valid you MUST declare the character encoding (lets the browser know whether to use A to Z letters (latin), or Chinese, Japanese, Thai, or Arabic script, or some other character set) used for the page, with something like:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

There are also other schemes such as UTF-8 and many others.


It is also a good idea to declare what language the page content is in, using:

<meta http-equiv="Content-Language" content="EN-GB">

The language and country codes come from ISO 4217 and ISO 3166. This is useful for online translation tools as well. Change the "en" and "gb" to whatever language and country you need.

The <title> tag is very importent. It shows in the SERPs, as well as along the top of the browser window:

<title> Your Title Here </title>

You need the meta description tag, and it is useful but not vital to have a meta keywords tag:

<meta name="Description" content=" Your Description Here. ">
<meta name="Keywords" content=" your, keyword, list, here ">

You might also want to include author and revision date information, usually for content control (versioning) purposes, but those have no relevance to search engines.


The last parts of your header should have your links to external style sheets and external javascript files:

Use this if the stylesheet is for all browsers:

<link type="text/css" rel="stylesheet" src="/path/file.css">

Use this for style sheet that you want to hide from older browsers, as older browsers often crash on seeing CSS:

<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"> @import url(/path/file.css); </style>

Use this for the javascript:

<script type="text/javascript" language="javascript" src="/path/file.js"></script>

End the header with this:

</head>
<body>

and then continue with the body page code.

It is as simple as that.

Don't bother with tags like revisit and so on, these are a waste of bandwidth.

Code within the page:

I use: <a href="somepage.html" title="some text here"></a> for links.

I use <img src="somefile.png" alt="some text"> for images.

Headings are done with <hx></hx> tags, properly used from <h1></h1> downwards.

bill




msg:573531
 2:15 am on Mar 26, 2004 (gmt 0)

But the language meta tag is worthless.
This is news to me. I was under the impression that some browsers, like older versions of Netscape used the language meta tags to switch encoding. This was a big issue for me when switching between Japanese, Chinese and English websites so I have always included those tags in my headers.
grahamstewart




msg:573532
 8:49 am on Mar 26, 2004 (gmt 0)

Otherwise, the default style sheet language is "text/css".

That's why I haven't been in any trouble by leaving it out. I only use CSS stylesheets.

Yeah the browser detection is such that you can leave it out and get away with it. However the text immediately after that bit says that..
Documents that include elements that set the style attribute but which don't define a default style sheet language are incorrect. Authoring tools should generate default style sheet language information (typically a META declaration) so that user agents do not have to rely on a default of "text/css".

So basically you should include this tag if you use inline styles.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved