HTML SPAN Tag || Span Tag in HTML
×

HTML SPAN <span> Tag

0 443

HTML SPAN <span> tag is define a generic container of inline tag. It work like div but <div> tag groups block-level elements, whereas the <span> groups inline elements.

It is used for styling purposes to the grouped inline tag (using class and id attribute or inline style).

The SPAN <span> tag is used to:

  • Apply scripts to exact parts of the text, for example, highlight the syntax of the code, etc.
  • To change the language of a part of the text.
  • To Change the font of separate words or phrases.
  • To change the color, font, background of a part of text using CSS.
  • To apply the scripts exact parts of the text.

Syntax:

<span> content goes here.. </span>

Program:

<!DOCTYPE html>
<html>
<head>
<title>HTML Span Tag</title>
</head>
<body>
 <h2>Example of Span Tag</h2>
 <p>Codingtag is the E-learning
	<span style="color:red;">website covering all aspects of</span>,
	<span style="color:green;">technical tutorials</span>.
</body>
</html>

Output:




Share:


Leave a Reply


Comments
    Waiting for your comments