How do we style HTML elements using the span tag <span>?

HTMLWeb DevelopmentFront End Technology

To style HTML using span, use the <span> tag. It is used to group and applies a style to inline elements. The HTML <span> tag is used for grouping and applying styles to inline elements.

The span tag in HTML is used with inline elements. Let us see how to use it.

You can try to run the following code to learn the usage of a <span> tag. Here, we will be using the <span> tag inside the <p> tag.


Live Demo

<!DOCTYPE html>
      <title>HTML span Tag</title>
      <p>Java is a Programming language widely followed. <span style = "color:#FF0000;">
         Developed by James Gosling. </span>This is demo text.</p>
         <span style = "color:#8866ff;">
            Current Version: 1.8 </span> </p>
Published on 01-Feb-2018 13:20:34