summaryrefslogtreecommitdiff
path: root/devdocs/html/element%2Fstrong.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/html/element%2Fstrong.html')
-rw-r--r--devdocs/html/element%2Fstrong.html103
1 files changed, 103 insertions, 0 deletions
diff --git a/devdocs/html/element%2Fstrong.html b/devdocs/html/element%2Fstrong.html
new file mode 100644
index 00000000..3d2577fc
--- /dev/null
+++ b/devdocs/html/element%2Fstrong.html
@@ -0,0 +1,103 @@
+<header><h1>&lt;strong&gt;: The Strong Importance element</h1></header><div class="section-content"><p>The <code>&lt;strong&gt;</code> <a href="../index">HTML</a> element indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type.</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/strong.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="usage_notes">Usage notes</h2>
+<div class="section-content">
+<p>The <code>&lt;strong&gt;</code> element is for content that is of "strong importance," including things of great seriousness or urgency (such as warnings). This could be a sentence that is of great importance to the whole page, or you could merely try to point out that some words are of greater importance compared to nearby content.</p> <p>Typically this element is rendered by default using a bold font weight. However, it should <em>not</em> be used to apply bold styling; use the CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight"><code>font-weight</code></a> property for that purpose. Use the <a href="b"><code>&lt;b&gt;</code></a> element to draw attention to certain text without indicating a higher level of importance. Use the <a href="em"><code>&lt;em&gt;</code></a> element to mark text that has stress emphasis.</p> <p>Another accepted use for <code>&lt;strong&gt;</code> is to denote the labels of paragraphs which represent notes or warnings within the text of a page.</p>
+</div>
+<h3 id="b_vs._strong">&lt;b&gt; vs. &lt;strong&gt;</h3>
+<div class="section-content">
+<p>It is often confusing to new developers why there are so many ways to express the same thing on a rendered website. <a href="b"><code>&lt;b&gt;</code></a> and <code>&lt;strong&gt;</code> are perhaps one of the most common sources of confusion, causing developers to ask "Should I use <code>&lt;b&gt;</code> or <code>&lt;strong&gt;</code>? Don't they both do the same thing?"</p> <p>Not exactly. The <code>&lt;strong&gt;</code> element is for content that is of greater importance, while the <code>&lt;b&gt;</code> element is used to draw attention to text without indicating that it's more important.</p> <p>It may help to realize that both are valid and semantic elements in HTML and that it's a coincidence that they both have the same default styling (boldface) in most browsers (although some older browsers actually underline <code>&lt;strong&gt;</code>). Each element is meant to be used in certain types of scenarios, and if you want to bold text for decoration, you should instead actually use the CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight"><code>font-weight</code></a> property.</p> <p>The intended meaning or purpose of the enclosed text should be what determines which element you use. Communicating meaning is what semantics are all about.</p>
+</div>
+<h3 id="em_vs._strong">&lt;em&gt; vs. &lt;strong&gt;</h3>
+<div class="section-content">
+<p>Adding to the confusion is the fact that while HTML 4 defined <code>&lt;strong&gt;</code> as indicating a stronger emphasis, HTML 5 defines <code>&lt;strong&gt;</code> as representing "strong importance for its contents." This is an important distinction to make.</p> <p>While <code>&lt;em&gt;</code> is used to change the meaning of a sentence as spoken emphasis does ("I <em>love</em> carrots" vs. "I love <em>carrots</em>"), <code>&lt;strong&gt;</code> is used to give portions of a sentence added importance (e.g., "<strong>Warning!</strong> This is <strong>very dangerous.</strong>") Both <code>&lt;strong&gt;</code> and <code>&lt;em&gt;</code> can be nested to increase the relative degree of importance or stress emphasis, respectively.</p>
+</div>
+<h2 id="examples">Examples</h2>
+
+<h3 id="basic_example">Basic example</h3>
+<div class="section-content">
+<div class="code-example">
+<p class="example-header"><span class="language-name">html</span></p>
+<pre data-signature="+ia1N9Cr/Ak2PJw0ZzSr6MjvzwYt24RhK5lB0/ynBVo=" 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>
+ Before proceeding, <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>strong</span><span class="token punctuation">&gt;</span></span>make sure you put on your safety goggles<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>strong</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="Basic example sample" id="frame_basic_example" width="650" height="80" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/strong/runner.html?id=basic_example" loading="lazy"></iframe>
+</div>
+</div>
+<h3 id="labeling_warnings">Labeling warnings</h3>
+<div class="section-content">
+<div class="code-example">
+<p class="example-header"><span class="language-name">html</span></p>
+<pre data-signature="aRvQkg5EdBGHvnO/h9OSM9U3Z0rxY/xx8glsxw4OjgM=" 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>strong</span><span class="token punctuation">&gt;</span></span>Important:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>strong</span><span class="token punctuation">&gt;</span></span> Before proceeding, make sure you add plenty of
+ butter.
+<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_2">Result</h4>
+<div class="code-example" id="sect2">
+
+<iframe class="sample-code-frame" title="Labeling warnings sample" id="frame_labeling_warnings" width="650" height="80" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/strong/runner.html?id=labeling_warnings" 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>, palpable content. </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; must have both a start tag and an end tag.</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><code><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/structural_roles#structural_roles_with_html_equivalents">strong</a></code></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/HTMLElement"><code>HTMLElement</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-strong-element">HTML Standard <br><small># the-strong-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>strong</code></th>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">12</td>
+<td class="bc-supports-yes"><details><summary>1</summary>Before Firefox 4, creating a <code>&lt;strong&gt;</code> element incorrectly resulted in an <code>HTMLSpanElement</code> object, instead of the expected <code>HTMLElement</code>.</details></td>
+<td class="bc-supports-yes">Yes</td>
+<td class="bc-supports-yes">15</td>
+<td class="bc-supports-yes">≤4</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">≤3.2</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>The <a href="b"><code>&lt;b&gt;</code></a> element</li> <li>The <a href="em"><code>&lt;em&gt;</code></a> element</li> <li>The <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight"><code>font-weight</code></a> property</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/strong" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong</a>
+ </p>
+</div>