HTML <span> tag
Updated: 04/02/2019 by Computer Hope
When writing in HTML (HyperText Markup Language), the <span> tag is used as an inline container for grouping or phrasing content. It's useful when you want to change the language of a section of text, or its styling, via CSS (Cascading Style Sheets) or the <style> tag. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.
Example of <span> code
<p>I drive an <span style="color:orange">orange</span> car.</p>
Example result
I drive an orange car.
Attributes
All HTML tags support standard attributes that define the settings of an HTML element. Unlike other HTML tags, the <span> tag has no unique attributes.
Compatibility
Edge | Internet Explorer | Firefox | Safari | Opera | Chrome |
---|---|---|---|---|---|
All versions | All versions | All versions | All versions | All versions | All versions |
Browser, Compatibility, Container tag, CSS, HTML <div> tag, Web design terms