HTML Span Tags...

Styles and Semantics

HTML Span Tag

Generally HTML span tag is used to apply the inline styles on some specific character, words or other HTML elements. It is a paired tag.

Syntax: 

 <span>-----------------</span>

Example:

<body>

<span style="color:red">Welcome to SPAN </span>

</body>

Example:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>HTML forms</title>

</head>

<body>

  <span style='color:red'>Welcome to Span tag.....!!!</span><br>

  <span style='color:green'>Welcome to Span tag.....!!!</span><br>

  <span style='color:blue'>Welcome to Span tag.....!!!</span>

</body>

</html>


Example:

<body>

<span style="color:red">Welcome to SPAN </span>

</body>


Example:

<!doctype html>

<body>

<span style='color:red;font-family:tahoma;font-size:30px'>Welcome to Span tag..!!</span> <br>


<span style='color:green;font-family:candara;font-size:40px'>Welcome</span> to Span tag..!! <br>


<span style='color:blue;font-family:arial;font-size:90px'>W</span>elcome to Span tag..!!


<!-- style attribute is global attribute to apply different styles from Cascading Style Sheets -->

</body>