Header Ads

Inline Span


The <span> tag groups inline-elements in a document. For example, if one word in a
sentence need to be bold or colored without using the <b> tag then a <span> tag is used
which can be present within an existing tag.

Code Snippet 1 demonstrates CSS inline style for <span> tag.
Code Snippet 1:


<p>My mother has <span style=”color: lightblue”>light blue</span>
eyes.</p>


Or


<span class=”eyesonly”>light blue</span>
Code Snippet 2 demonstrates CSS external style for <span> tag.


Code Snippet 2:

.eyesonly {font-color: lightblue}

The span tag has different attributes; it supports JavaScript event attributes also. 
lists different attributes and values used in <span> tag.




No comments:

Powered by Blogger.