Detailed usage of HTML span 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

Recommended Today

The way of nonlinear optimization

Mathematical knowledge 1、 Nonlinear functionLinear function is another name of a function of first degree, then nonlinear function means that the function image is not a function of a straight line.Nonlinear functions include exponential function, power function, logarithmic function, polynomial function and so on. 2、 Taylor expansion1. Taylor formula:Taylor’s formula is to add a_ The […]