TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML span Tag

HTML span Tag with html tutorial, tags, anchor, img, div, entity, textarea, marquee, p tag, heading tag, h1, h2, table, formatting, attribute, elements, ol, ul, Input Types, block element tag, inline element tag, html tags, phrase tag, head, body, form, lists, symbols etc.

<< Back to HTML

HTML <span> tag

HTML <span> tag is used as a generic container of inline elements. It is used for styling purpose to the grouped inline elements (using class and id attribute or inline style).

The <span> tag does not have any default meaning or rendering.

The <span> tag can be useful for the following task:

  • To change the language of a part of the text.
  • To change the color, font, background of a part of text using CSS
  • To apply the scripts to the particular part of the text.

Note: HTML <span> is much similar as <div> tag, but <div> is used for block-level elements and <span> tag is used for inline elements.

Syntax

	<span>Write your content here......</span>

Following are some specifications about the HTML <span> tag

Display Inline
Start tag/End tag Both Start and End tag
Usage Styles and semantics

Example

<!DOCTYPE html>
<html>
<head>
 <title>Span Tag</title>
 </head>
<body>
  <h2>Example of span tag</h2>
  <p>I have choosen only 
  	<span style="color: red;">red</span>, 
  	<span style="color: blue;">blue</span>, and
  	<span style="color: green;">green</span> colors for my painting.
  </p>
</body>
</html>
Test it Now

Output:

HTML span tag

Attribute:

Tag-specific attributes:

The <span> tag does not contain any specific attribute in HTML.

Global attribute:

The <span> tag supports the Global attributes in HTML.

Event attribute:

The <span> tag supports the Event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<span>YesYesYesYesYes
Next TopicHTML strike Tag




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf