summaryrefslogtreecommitdiff
path: root/devdocs/html/element%2Fspan.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/html/element%2Fspan.html
new repository
Diffstat (limited to 'devdocs/html/element%2Fspan.html')
-rw-r--r--devdocs/html/element%2Fspan.html96
1 files changed, 96 insertions, 0 deletions
diff --git a/devdocs/html/element%2Fspan.html b/devdocs/html/element%2Fspan.html
new file mode 100644
index 00000000..332a3f51
--- /dev/null
+++ b/devdocs/html/element%2Fspan.html
@@ -0,0 +1,96 @@
+<header><h1>&lt;span&gt;: The Content Span element</h1></header><div class="section-content"><p>The <code>&lt;span&gt;</code> <a href="../index">HTML</a> element is a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the <a href="../global_attributes#class"><code>class</code></a> or <a href="../global_attributes#id"><code>id</code></a> attributes), or because they share attribute values, such as <a href="../global_attributes#lang"><code>lang</code></a>. It should be used only when no other semantic element is appropriate. <code>&lt;span&gt;</code> is very much like a <a href="div"><code>&lt;div&gt;</code></a> element, but <a href="div"><code>&lt;div&gt;</code></a> is a <a href="https://developer.mozilla.org/en-US/docs/Glossary/Block-level_content">block-level element</a> whereas a <code>&lt;span&gt;</code> is an <a href="https://developer.mozilla.org/en-US/docs/Glossary/Inline-level_content">inline-level element</a>.</p></div>
+<h2 id="try_it">Try it</h2>
+<div class="section-content"><iframe class="interactive is-tabbed-shorter-height" height="200" src="https://interactive-examples.mdn.mozilla.net/pages/tabbed/span.html" title="MDN Web Docs Interactive Example" loading="lazy"></iframe></div>
+<h2 id="attributes">Attributes</h2>
+<div class="section-content"><p>This element only includes the <a href="../global_attributes">global attributes</a>.</p></div>
+<h2 id="example">Example</h2>
+
+<h3 id="example_1">Example 1</h3>
+<div class="section-content">
+<h4 id="html">HTML</h4> <div class="code-example">
+<p class="example-header"><span class="language-name">html</span></p>
+<pre data-signature="/1LifhEX+VZAZChGdanvRaMz9IOFdGLznGSZgB7uqcQ=" data-language="html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>Some text<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
+</pre>
+</div> <h4 id="result">Result</h4>
+<div class="code-example" id="sect1">
+
+<iframe class="sample-code-frame" title="Example 1 sample" id="frame_example_1" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/span/runner.html?id=example_1" loading="lazy"></iframe>
+</div>
+</div>
+<h3 id="example_2">Example 2</h3>
+<div class="section-content">
+<h4 id="html_2">HTML</h4> <div class="code-example">
+<p class="example-header"><span class="language-name">html</span></p>
+<pre data-signature="TJk3cIEcJaKZMyjoC3Vr9HJa3XPVT86AqoXZzXKe8MU=" data-language="html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span><span class="token punctuation">&gt;</span></span>
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span><span class="token punctuation">&gt;</span></span>
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>portfolio.html<span class="token punctuation">"</span></span> <span class="token attr-name">target</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>_blank<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>See my portfolio<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">&gt;</span></span>
+ <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">&gt;</span></span>
+<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
+</pre>
+</div> <h4 id="css">CSS</h4> <div class="code-example">
+<p class="example-header"><span class="language-name">css</span></p>
+<pre data-signature="CZUYCNVTUsHBcMNtifZGz3xxQNKn5otdoJ7UlA9rzuw=" data-language="css"><span class="token selector">li span</span> <span class="token punctuation">{</span>
+ <span class="token property">background</span><span class="token punctuation">:</span> gold<span class="token punctuation">;</span>
+<span class="token punctuation">}</span>
+</pre>
+</div> <h4 id="result_2">Result</h4>
+<div class="code-example" id="sect2">
+
+<iframe class="sample-code-frame" title="Example 2 sample" id="frame_example_2" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/span/runner.html?id=example_2" loading="lazy"></iframe>
+</div>
+</div>
+<h2 id="technical_summary">Technical summary</h2>
+<div class="section-content"><figure class="table-container"><div class="_table"><table class="properties"> <tbody> <tr> <th scope="row"><a href="../content_categories">Content categories</a></th> <td> <a href="../content_categories#flow_content">Flow content</a>, <a href="../content_categories#phrasing_content">phrasing content</a>. </td> </tr> <tr> <th scope="row">Permitted content</th> <td>
+<a href="../content_categories#phrasing_content">Phrasing content</a>.</td> </tr> <tr> <th scope="row">Tag omission</th> <td>None, both the starting and ending tag are mandatory.</td> </tr> <tr> <th scope="row">Permitted parents</th> <td> Any element that accepts <a href="../content_categories#phrasing_content">phrasing content</a>, or any element that accepts <a href="../content_categories#flow_content">flow content</a>. </td> </tr> <tr> <th scope="row">Implicit ARIA role</th> <td><a href="https://www.w3.org/TR/html-aria/#dfn-no-corresponding-role" target="_blank">No corresponding role</a></td> </tr> <tr> <th scope="row">Permitted ARIA roles</th> <td>Any</td> </tr> <tr> <th scope="row">DOM interface</th> <td><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLSpanElement"><code>HTMLSpanElement</code></a></td> </tr> </tbody> </table></div></figure></div>
+<h2 id="specifications">Specifications</h2>
+<div class="_table"><table class="standard-table">
+<thead><tr><th scope="col">Specification</th></tr></thead>
+<tbody><tr><td><a href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-span-element">HTML Standard <br><small># the-span-element</small></a></td></tr></tbody>
+</table></div>
+<h2 id="browser_compatibility">Browser compatibility</h2>
+<div class="_table"><table>
+<thead>
+<tr id="bct-browser-type">
+<th></th>
+<th colspan="6">Desktop</th>
+<th colspan="6">Mobile</th>
+</tr>
+<tr id="bct-browsers">
+<th></th>
+<th>Chrome</th>
+<th>Edge</th>
+<th>Firefox</th>
+<th>Internet Explorer</th>
+<th>Opera</th>
+<th>Safari</th>
+<th>WebView Android</th>
+<th>Chrome Android</th>
+<th>Firefox for Android</th>
+<th>Opera Android</th>
+<th>Safari on IOS</th>
+<th>Samsung Internet</th>
+</tr>
+</thead>
+<tbody><tr>
+<th><code>span</code></th>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">12</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">Yes</td>
+<td class="bc-supports-yes">15</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">4.4</td>
+<td class="bc-supports-yes">18</td>
+<td class="bc-supports-yes">4</td>
+<td class="bc-supports-yes">14</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">1.0</td>
+</tr></tbody>
+</table></div>
+<h2 id="see_also">See also</h2>
+<div class="section-content"><ul> <li>HTML <a href="div"><code>&lt;div&gt;</code></a> element</li> </ul></div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2005&ndash;2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br>
+ <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span</a>
+ </p>
+</div>