Forum Moderators: open

Message Too Old, No Replies

Correct Meta Tag Format

Questions on Odd Formatting of Tags

         

richmar

1:06 am on Jan 25, 2006 (gmt 0)

10+ Year Member



Am doing SEO for a large client site, and after writing the content for the meta tags -- the developer came back with a format for the description and keyword tags that I have never seen before:

<meta content="blah, blah, blah."
name="description"></meta>

<meta content="blah, blah, blah"
name="keywords"></meta>

My question - is this ok? Preferred? Also, assuming SE crawlers see text in linear fashion, shouldn't content="description" appear at the front of the tag instead of at the back of the tag? Is the close </meta> tag necessary?

Would love your feedback.

Thanks,
Richmar

tedster

2:50 am on Jan 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello richmar, and welcome to the forums.

The "content" and "name" are element attributes -- so the order they are listed in "should" not matter. But being aligned to standard practices is always a good idea.

I would suggest removing the line breaks that I see above. Again, it "shouldn't" be a problem, by why tempt fate.

And finally, closing tags are required for all elements in xhtml -- so I assume an xhtml dtd is being used here. Or perhaps the tags were just copied from an xhtml document. Although the shorter version of the meta element is more commonly see --: <meta name="description" content="blah, blah" /> -- this form is also acceptable.

As a general rule, not getting unneccessarily creative around standard practices (no matter how correct the creativity is) is usually the best bet. You never know when some programmer somewhere is going to make an unwarranted assumption and your page doesn't make some hurdle or other because of it.

encyclo

2:54 am on Jan 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums richmar.

The order of the attribute values in the meta tags iss not a problem - you can specify name first then value or vice-versa, as shown in your example. I agree with tedster above that the line breaks are a bad idea and should be removed.

For the closing

</meta>
tags, it is strictly-speaking not invalid when using XHTML syntax (does the page have an XHTML doctype?), however in standard HTML the meta element does not have a closing tag. It is unlikely to cause any problems, and will probably just be ignored by parsers. Personally, I would remove them.

richmar

6:12 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



Thanks everyone. I don't use line breaks. I copied that example from another tiny window, so it appears as if line breaks were inserted.

Good info - I'll check with our developers to see if they are using xhtml doctypes.