HTML span <span> tag
0 1947
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:
Comments
Waiting for your comments