Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3344392
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:03:51+00:00 2026-05-18T01:03:51+00:00

There are many people that mark closing tags like this to help identify the

  • 0

There are many people that mark closing tags like this to help identify the closing tag that goes with an HTML tag:

<div id="header">
  <div id="logo">
    <a href="index.php">
      <img id="logoimg" src="images/as_logo.png" alt="Logo" border="0" />
    </a>
  </div> <!-- logo -->
</div> <!-- header -->

I was wondering if it is syntactically ok to do this:

<div id="header">
  <div id="logo">
    <a href="index.php">
      <img id="logoimg" src="images/as_logo.png" alt="Logo" border="0" />
    </a>
  </div id="logo">
</div id="header">

UPDATE: Here is the text from the spec on HTML5.3:

8.1.2.2. End tags
End tags must have the following format:

  1. The first character of an end tag must be a U+003C LESS-THAN SIGN
    character (<).
  2. The second character of an end tag must be a U+002F
    SOLIDUS character (/).
  3. The next few characters of an end tag must be
    the element’s tag name.
  4. After the tag name, there may be one or more
    space characters.
  5. Finally, end tags must be closed by a U+003E
    GREATER-THAN SIGN character (>).

8.1.2.3. Attributes
Attributes for an element are expressed inside the element’s start tag.

Note that attributes are only allowed on START TAGS.

using @jbyrds idea; using the HR tag allows you to see if you forgot the z attribute:

<div id="header">
  <div id="logo">
    <a href="index.php" id=link">
      <img id="logoimg" src="images/as_logo.png" alt="Logo" border="0" />
    </a><hr z="link">
  </div><hr z="logo">
</div><hr z="header">

Although this adds more text, 32 extra characters vs. the original or the tags having a hidden class, you can use CSS to hide them.

[z] {
    display: none;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:03:51+00:00Added an answer on May 18, 2026 at 1:03 am

    The answer is no for most tags. However, you could argue that tags like “img” that can be self-closing, are able to have attributes in them. But these self-closing tags are taking the place of an opening tag and a closing tag, so it’s not the same as having an attribute in a closing tag. To be honest, there is really no need for this, it would just create more for the browser to have to read and make the page size bigger.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are many questions like this but I can't find one that seems to
Here's something interesting, turnsout that many people out there had this problem, but i
Ok , so many people are asking this question, and there are many approaches
Whilst there are many good examples on this forum that contain examples of coupling
I think there are not many people who don't think that ASP.NET MVC is
Let's say I have text like: <p>There are many people in Asia.</p> I want
Edit Since there were many downvotes and people who didn't understand what I'm asking
There are many how-to's for people who want to use Rails with Apache and
There are many errors here in SO, but this scenario I think its different.
There are many similar questions, but I didn't find one that gets straight to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.