开发者

What is HTML ending tag called?

开发者 https://www.devze.com 2023-02-11 00:20 出处:网络
Just wondering, what do you call the </div> in <div>开发者_StackOverflow中文版</div>?

Just wondering, what do you call the </div> in <div>开发者_StackOverflow中文版</div>?

I get that the front is called the tag, but is the back called the same thing?


It's called the closing tag, as in "self-closing tag".
It can also be called the end(ing) tag.


It's an end tag or closing tag.


They are called precisely that. The first tag is the opening or start tag, and the second is the closing or end tag.


According to Wikipedia's page on XML:

Tag
A markup construct that begins with "<" and ends with ">". Tags come in three flavors: start-tags, for example <section>, end-tags, for example </section>, and *empty-element tag*s, for example <line-break />.


It's either end tag or closing tag. Some tags come in pairs and some don't. The ones that come in pairs do so because you are normally telling something where to start applying some formatting and where to end it. Like in this one we are saying where to start and end the bolding, so we need the second tag to tell it to stop. So for example, this line has part of it bolded, but it is clear when it starts and ends:

This bit of text includes some <b>bold</b> text. 

Other tags have no need to have something set to end, like a line break. A line break is a single instruction, so you only need one tag. You don't need to tell a line break when to stop.


As Meder said it's an end tag or closing tag. Oftentimes though the reason for a question like this is how to refer to it when talking about it. In speaking it out-loud I'd usually refer to it as end __ (whatever the tag is). So, I would say this would be div ... end-div if that helps at all.


<div></div>

Here, <div> is starting/opening tag. </div> is ending/closing tag.

Some tags are like <br />. These are known as self-ending tags. Because these ends within themselves.

0

精彩评论

暂无评论...
验证码 换一张
取 消