Posts in current category

HTML5 <span> tag

May 03, 2021 18:00 HTML5

Table of contents

The contents of an HTML5-lt;span-gt; label are independent of the document, and when styles are applied to the label, the contents contained there appear differently visually. Please refer to the following example:

Color a portion of the text using the element:

<p>我的母亲有 <span style="color:blue">蓝色</span> 的眼睛。</p>
Try it out . . .

Browser support

HTML5 <span> tag HTML5 <span> tag HTML5 <span> tag HTML5 <span> tag HTML5 <span> tag

All major browsers support the hashtag.

Label definition and instructions for use

Used to combine in-line elements in a document.

The label does not appear in a fixed format. W hen a style is applied to it, it produces a visual change. I f you don't apply a style to the .lt;span; element, there will be no visual difference between the text in the element and the other text.

Labels provide a way to separate parts of text or parts of a document.

Tips and comments

Tip: The text contained in the element, you can use CSS to define a style for it, or javaScript to manipulate it.

The difference between HTML 4.01 and HTML5


Global properties

The label supports the global properties of HTML.

The event property

The tag supports the event properties of HTML.