<span> - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:span

Introduction

The span element can apply global attributes to a region of content.

The span Element summary

ItemValue
Element span
Local AttributesNone
Tag Style Start and end tag
New in HTML5 No
Changes in HTML5 None
Style Convention None

The following code shows the span element used with the class attribute to apply a CSS style.

Using the span Element

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <title>Example</title> 
      <style>
.fruit {<!--from ww  w  .  j  a  va 2s.c om-->
   border: thin solid black;
   padding: 1px;
}

      </style> 
   </head> 
   <body>
       I like 
      <span class="fruit">CSS</span>
       and 
      <span class="fruit">HTML</span>
      .  
   </body>
</html>

Related Tutorials