View video tutorial

HTML <span> Tag


The <span> tag is used to style a part of an element.

HTML <span> Tag

The <span> element is a generic inline container.

<span> is a lot like the <div> element, but <div> is a block-level element where a <span> is an inline element.

To style or process some inline parts of an element, <span> is useful and solves problems.

Global attributes

Global attributes may be applied on all elements, although some elements may have no effect on them.

<accesskey>, <class>, <contenteditable>, <contextmenu>, <data-*>, <dir>, <draggable>, <dropzone>, <hidden>, <id>, <lang>, <spellcheck>, <style>, <tabindex>, <title>, <translate>.

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.


<p>To <span style="color:#902255; font-size:20pt;">style</span> or process some inline parts of an element, <span
        style="color:#1717ff; font-size:20pt;">span</span> is useful and solves problems</p>
Try it Now »

Click on the "Try it Now" button to see how it works.