简体   繁体   中英

Why is a div called a div? Why is a span called a span?

My assumption is that div means "divider" because it divides elements (due to the new line before and after), and that span is called span because it's inline, so it "spans" its content. Was it ever directly indicated where they came up with these names?

According to HTML 3.2 reference <div> stands for "document divisions".

<span> simply comes from the related verb.
The physically written <span> and </span> tags span their content. One before, one after. They do nothing more, have no semantic use, no meaning, and are generics, which could explain such a name. For another example, it could have been <encompass> .
(Nothing clear in HTML 4 refs)

The div tag defines a division or a section in an HTML document.

The div tag is used to group block-elements to format them with CSS http://www.w3schools.com/tags/tag_div.asp

The span tag is used to group inline-elements in a document.

The span tag provides no visual change by itself.

The span tag provides a way to add a hook to a part of a text or a part of a document. http://www.w3schools.com/tags/tag_span.asp

A Div is a Division, since it divides things into groups.

My guess is that span is like a "Span of" something or group.

"the full extent of something from end to end; the amount of space that something covers."

Div是一个块级元素,它创建一个换行符以在页面或文档中创建单独的容器或框,因此它是'division'的缩写,而span是内联元素和内容的通用容器,允许我们应用样式和span元素中内容的其他属性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM