Home >Web Front-end >HTML Tutorial >The difference between div and span in HTML (common points and differences)_HTML/Xhtml_Web page production

The difference between div and span in HTML (common points and differences)_HTML/Xhtml_Web page production

WBOY
WBOYOriginal
2016-05-16 16:39:141652browse

Common ground:

DIV tags and SPAN tags treat some content as a whole, for example, hiding it as a whole and moving it as a whole. Something like a box. Doing this can streamline the code and improve efficiency.

Differences:

1. div puts the content into a rectangular block, and moving it at will will affect the layout. Span only defines the content as a whole and operates it without affecting the layout and display.

2. div is generally used for typesetting, while span is generally used for local text styling.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn