DEV Community

Divya Divya
Divya Divya

Posted on

What is the use of span tag?Give an example.

Span tag for use is to group elements for styling purposes (by using the class or id attributes) to adding color to text and adding background text and highlight any color text.
Example:

<p>
<span style ="color:red;">
on this page we use span.
</span>
</p>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)