Tuesday, February 5, 2013


Span tag in HTML5


The HTML <span> tag is used for grouping and applying styles to inline elements.
The difference between the <span> tag and the <div> tag is that the <span> tag is used with inline elements whilst the <div> tag is used with block-level content.


The HTML <span> tag is used to group inline-elements in a document.
The HTML <span> tag provides no visual change by itself.
The HTML <span> tag provides a way to add a hook to a part of a text or a part of a document.


Tip: When a text is hooked in a <span> element, you can style it with CSS, or manipulate it with JavaScript.


It is available in the previous versions of HTML.
It supports both Global Attributes and Event Attributes in HTML5.


Cons :

It is applicable to all major browsers only.



<style type="text/css">
.tab
{
font-family: Monaco, Verdana, Sans-serif;
font-size:12px;
border: 1px solid #D0D0D0;
color: #002166;
 }
</style>
<h1>Demo on Span Element</h1>
<table cellpadding=4 cellspacing=6 border="0">
<tbody>
<tr>
<th>Scripts</th><th>Tutorials</th>
</tr>
<tr>
<td><span class='tab'> JAVA  Script</span></td>
<td><span class='tab'>CSS Tutorial</span></td>
</tr>
</tbody>
</table>

 Output :
======


No comments:

Post a Comment