What does span do in HtmlThe span is a tag in Html. Html <span> tag is used for grouping the inline elements and applying the style to them. This tag applies the styles by using the class or id attributes. This tag is similar to the Html <div> tag, but it is an inline tag. This tag is used at that time when there is no other semantic tag is present to use. <span> tag is a paired tag, i.e., it has open as well as close tag, so it is mandatory to close this tag. We can easily understand the <span> tag by the examples. So, we will provide the following various examples. Example 1: The following example uses the span tag with the inline style attribute. Test it NowThe output of above Html code is shown in the following screenshot: Example 2: The following example uses the span tag with the internal CSS. Test it NowThe output of above Html code is shown in the following screenshot:
Next TopicHow to make a Navigation Bar in Html
|
Javatpoint provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India