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

  • Home
  • SEARCH
  • 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 6027663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:37:32+00:00 2026-05-23T04:37:32+00:00

Why do some html opening/start tags require a closing/end tag? for example, <script> requires

  • 0

Why do some html opening/start tags require a closing/end tag?

for example, <script> requires a </script>, while <img> can (in fact, must) be self-closing (<img src="path.jpg" />)?

I would assume it has to do with requiring content between start and end tags, but with the example of <script>, <script src="file.js"></script> doesn’t need anything in between…

I ask because I burned time trying to figure out why my included script was working in Safari but not in FF or Chrome. it was because I incorrectly self-closed the script tag. bleh.

  • 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-23T04:37:33+00:00Added an answer on May 23, 2026 at 4:37 am

    The reason for the existence of self closing tags is that certain elements naturally will never have content that goes between the tags. For instance, think about the <br / tag. When would something like <br></br> be useful? It’s really just a waste of character space and time. This syntax stems from the XML syntax and became part of XHTML.

    Determining which tags can/should be self closing is up the HTML parser in the browser. The HTML specification for the version you’re using should define the way things are handled, but of course we all know that it never necessarily the case.

    Here is a great article about self closing tags in HTML5 (& past versions) for your reference.

    http://tiffanybbrown.com/2011/03/23/html5-does-not-allow-self-closing-tags/

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

Sidebar

Related Questions

I am reading some C text at the address: https://cs.senecac.on.ca/~btp100/pages/content/files.html in the section OPENING
browsing some html code I find a text input coded as: <input type=text name=Email<%=orderRow.ID
I've been doing some HTML scraping in PHP using regular expressions. This works, but
I want to parse some HTML in order to find the values of some
There are some HTML based games (ie bootleggers.us) that have a simple login form
I have some HTML that looks like this: <ul class=faq> <li class=open> <a class=question
I have some HTML menus, which I show completely when a user clicks on
So I have some html like so: <div id=avatar_choices> <label for=id_choice_0> <input id=id_choice_0 type=radio
I have some HTML that displays fine on FireFox3/Opera/Safari but not with IE7. The
I have some HTML and jQuery that slides a div up and down 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.