<span> - 如何以及何时使用?

时间:2018-01-11 18:13:31

标签: javascript html css

什么是<span>,我什么时候使用它?

我尝试了什么:

<html>
<head>
    <title>example</title>
</head>
<body>
    <h1>This is my first site</h1>
    <span>hello, nice to meet you!</span><span>I really need help!</span>
    <p>I am new to web development and I am excited to start this journey. I hope that I make some friends during this experience.</p>
</body>
</html>

1 个答案:

答案 0 :(得分:2)

<span>元素的一个示例用法可能是为文本的一部分着色:

<p>My mother has <span style="color:blue">blue</span> eyes.</p>

定义和用法

<span>标记用于对文档中的内联元素进行分组。

<span>标记本身不会发生任何视觉变化。

<span>标记提供了一种向文本的一部分或文档的一部分添加钩子的方法。