Forum Moderators: open
<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
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.
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.