Detailed usage of HTML tags

Time:2019-10-23

HTML <span>tags

  • <span>Used to combine inline elements in a document.
  • <span>Tags do not have a fixed format representation. When you style it, it changes visually. If you don’t<span>Apply styles, so<span>The text in the element is not visually different from any other text.
  • <span>Tags provide a way to separate part of the text or part of the document.

HTML <span>Tag usage

use<span>Element to color a part of the text:

<p> there's one in the front circle
    <span style="color:blue"
</p>

HTML <span>Label the demonstration

<p> there’s one in the front circle

<span style="color:blue"

</p>


Browser support

All major browsers support it<span>The label.


Hints and comments

Tip: be<span>The element contains text that you can style using CSS or manipulate using JavaScript.


The difference between HTML4 and HTML5

NONE.


Global properties

<span>Tags support HTML global attributes.


Event attributes

<span>Tags support HTML event attributes

This article refers to the HTML Chinese help document