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

No, not secret CIA crap.. but just about as tough to crack for most of us. He's got it all, css, html, xhtml, php.. you name it!

Moderator: Zorro

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

Postby BlackCat » September 18th, 2013, 9:25 pm

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?
User avatar
BlackCat
 
Posts: 1674
Joined: February 12th, 2011, 12:05 pm

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

Postby Bullet Magnet » September 19th, 2013, 12:30 pm

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.
User avatar
Bullet Magnet
Squad Member
 
Posts: 1472
Joined: February 6th, 2011, 5:53 pm

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

Postby Zorro » September 19th, 2013, 4:47 pm

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.
Research shows that one in three Clinton supporters are just as stupid as the other two.
Zorro
Squad Member
 
Posts: 543
Joined: February 5th, 2011, 12:25 pm

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

Postby BlackCat » September 19th, 2013, 6:37 pm

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).
User avatar
BlackCat
 
Posts: 1674
Joined: February 12th, 2011, 12:05 pm


Return to El Zorro's casa de la Codes

Who is online

Users browsing this forum: No registered users and 3 guests

cron