The HTML <span>
tag is used to group and style in-line elements.
Various attributes can be set in the <span>
tag. The general syntax to do so is as follows:
<p <span style="attribute: value.."> </p>
The <span>
tag is supported by the following browsers:
<span>
tag to highlight a certain part of the text:<span>
tag can also be used to group elements.Consider the following example in which we wish to style particular sub-strings throughout the text. This can be achieved by creating a class and styling it as desired. The class name can then be used throughout the code within the <span>
tag to assign it the particular properties.