homepage Welcome to WebmasterWorld Guest from 54.234.228.64
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Closing for Meta Tags in HTML 401
montman




msg:4109160
 11:25 pm on Apr 2, 2010 (gmt 0)

I have inherited a very old website with this DOCTYPE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

When I put the closing tag like />, and run a validation check in Dreamweaver, I get the message that this is invalid, and I now understand that it needs to be closed without the forward slash.

But my question is: Will search engines use the description okay without the forward slash in the closing tag?

 

lavazza




msg:4109165
 11:41 pm on Apr 2, 2010 (gmt 0)

>> my question is: Will search engines use the description okay without the forward slash in the closing tag?

Yes

:)

montman




msg:4109171
 11:59 pm on Apr 2, 2010 (gmt 0)

Thank you for your answer.

montman




msg:4109186
 1:07 am on Apr 3, 2010 (gmt 0)

I was focusing on the meta description and forgot to ask: As all the meta tags are not validating, will there be any problems if I delete the ending forward slash in all of them, including this one:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

lavazza




msg:4109194
 1:31 am on Apr 3, 2010 (gmt 0)

For your files to validate as HTML4 (in contrast with XHTML) you'll have to remove ALL of the slashes in ALL meta tags - and any other self-closing tags

e.g.

<hr> NOT <hr />
<br> NOT <br />

tedster




msg:4109230
 3:14 am on Apr 3, 2010 (gmt 0)

And don't forget:

<img> NOT <img />

montman




msg:4109246
 4:45 am on Apr 3, 2010 (gmt 0)

Thanks so much to both of you. That is very helpful!

pageoneresults




msg:4109261
 5:23 am on Apr 3, 2010 (gmt 0)

I'd be real careful in answering with an emphatic yes on this particular issue. You might find this read from the Code Project rather interesting...

How to Stop Google Indexing Your Site. A Bedtime Story.
[CodeProject.com...]

The problem we faced was that we had specified HTML 4.01 in our DOCTYPE but were trying to use XHTML style tags (i.e. self closing meta tags). IE had no problem with it. Firefox, Opera and even my blackberry had no problem with it (or if they did have a problem they were polite enough not to say anything). Yahoo didn't have a problem. But Google did.


I'd like to think that is one of those errors that is easily recovered from. According to the above findings, that may not be the case, at least it wasn't in their particular instance.

No, follow protocol and use the proper markup for the DOCTYPE you're using.

montman




msg:4109478
 5:26 pm on Apr 3, 2010 (gmt 0)

Now I'm confused. My document is a HTML 4.01 doctype, and all the other responses said not to use the forward slash for closing tags in my pages with this doctype, and that is what the article is suggesting.

But you said to be real careful in answering an emphatic yes on this issue. Is there still risk in implementing what the other responders said? and "No, follow protocol and use the proper markup for the DOCTYPE you're using," Isn't that what the other people who posted are suggesting?

pageoneresults




msg:4109485
 5:44 pm on Apr 3, 2010 (gmt 0)

My document is a HTML 4.01 doctype


If you're using an HTML 4.01 DOCTYPE, you will not have the XHTML closing elements.

Many will tell you not to worry about it because the crawlers will figure it out. Thing is, that is not always the case as evidenced by the story provided above.

It is bad practice to blend HTML/XHTML specific markup. It SHOULD be one or the other.

HTML

...">
<br>
<hr>
etc.

XHTML

..." />
<br />
<hr />
etc.

montman




msg:4109490
 5:55 pm on Apr 3, 2010 (gmt 0)

Thank you.

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