Page 1 of 1

Why do I always see a space between " and /> in HTML?

PostPosted: September 18th, 2013, 9:25 pm
by BlackCat
When I view source codes of websites to see what everyone is doing, I notice that everyone puts a space between an end quote and the forward slash, right before the closing bracket.

What makes....

Code: Select all
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />


different than....

Code: Select all
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>


??

Are search engines happy without the space or could this screw up how the bots read metadata?

Re: Why do I always see a space between " and /> in HTML?

PostPosted: September 19th, 2013, 12:30 pm
by Bullet Magnet
Zorro will have to fill us in on any possible technical reasons, but I can't imagine it affects SEO.

I'm guessing, like most standards, it points back to semantic value and readability. Much more identifiable as a self-enclosing tag when you see the space.

Re: Why do I always see a space between " and /> in HTML?

PostPosted: September 19th, 2013, 4:47 pm
by Zorro
Bullet Magnet is absolutely correct and he explained the reason for the space perfectly. From a SEO standpoint, it doesn't affect SEO in any way because the need for self closing tags is entirely dependent on what version of the HTML spec you're following.

Re: Why do I always see a space between " and /> in HTML?

PostPosted: September 19th, 2013, 6:37 pm
by BlackCat
Okay, thanks for the info. It seems as though it's just more typing but I guess it's not as obvious to people who don't use N++ (since it distinguishes HTML elements well by color).