-2

What is a <span> and when do I use it?

What I tried :

<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>
Melchia
  • 22,578
  • 22
  • 103
  • 117
  • 3
    This is something you can easily google. For example https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span – j08691 Jan 11 '18 at 18:15
  • Hi, welcome to SO. When you use a tag please make sure to read the definition. In this case, tags is not supposed to be used for html tags. – Elin Jan 11 '18 at 18:17

1 Answers1

2

One example usage of a <span> element could be to color a part of text:

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

Definition and Usage

The <span> tag is used to group inline-elements in a document.

The <span> tag provides no visual change by itself.

The <span> tag provides a way to add a hook to a part of a text or a part of a document.

random_user_name
  • 25,694
  • 7
  • 76
  • 115
Melchia
  • 22,578
  • 22
  • 103
  • 117