summaryrefslogtreecommitdiff
path: root/devdocs/html/element%2Fwbr.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%2Fwbr.html
new repository
Diffstat (limited to 'devdocs/html/element%2Fwbr.html')
-rw-r--r--devdocs/html/element%2Fwbr.html78
1 files changed, 78 insertions, 0 deletions
diff --git a/devdocs/html/element%2Fwbr.html b/devdocs/html/element%2Fwbr.html
new file mode 100644
index 00000000..2d4b2e6b
--- /dev/null
+++ b/devdocs/html/element%2Fwbr.html
@@ -0,0 +1,78 @@
+<header><h1>&lt;wbr&gt;: The Line Break Opportunity element</h1></header><div class="section-content"><p>The <code>&lt;wbr&gt;</code> <a href="../index">HTML</a> element represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location.</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/wbr.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="notes">Notes</h2>
+<div class="section-content">
+<p>On UTF-8 encoded pages, <code>&lt;wbr&gt;</code> behaves like the <code>U+200B ZERO-WIDTH SPACE</code> code point. In particular, it behaves like a Unicode bidi BN code point, meaning it has no effect on <a href="https://developer.mozilla.org/en-US/docs/Glossary/BiDi">bidi</a>-ordering: <code>&lt;div dir=rtl&gt;123,&lt;wbr&gt;456&lt;/div&gt;</code> displays, when not broken on two lines, <code>123,456</code> and not <code>456,123</code>.</p> <p>For the same reason, the <code>&lt;wbr&gt;</code> element does not introduce a hyphen at the line break point. To make a hyphen appear only at the end of a line, use the soft hyphen character entity (<code>&amp;shy;</code>) instead.</p>
+</div>
+<h2 id="examples">Examples</h2>
+<div class="section-content">
+<p><em><a href="https://web.archive.org/web/20121014054923/http://styleguide.yahoo.com/" target="_blank">The Yahoo Style Guide</a></em> recommends <a href="https://web.archive.org/web/20121105171040/http://styleguide.yahoo.com/editing/treat-abbreviations-capitalization-and-titles-consistently/website-names-and-addresses" target="_blank">breaking a URL <em>before</em> punctuation</a>, to avoid leaving a punctuation mark at the end of the line, which the reader might mistake for the end of the URL.</p> <div class="code-example">
+<p class="example-header"><span class="language-name">html</span></p>
+<pre data-signature="4s7hWl5kN2nPA0+IC1dvaua6h1SuMOc3rJlCmECm5yU=" 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>
+ http://this<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>.is<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>.a<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>.really<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>.long<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>.example<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>.com/With<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/pages<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/pages<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/pages<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/pages<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>wbr</span> <span class="token punctuation">/&gt;</span></span>/pages
+<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>
+</div>
+<h3 id="result">Result</h3>
+<div class="section-content"><div class="code-example" id="sect1">
+
+<iframe class="sample-code-frame" title="Examples" id="frame_example" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/wbr/runner.html?id=example" 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>Empty</td> </tr> <tr> <th scope="row">Tag omission</th> <td> It is a <a href="https://developer.mozilla.org/en-US/docs/Glossary/Void_element">void element</a>; it must have a start tag, but must not have 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>. </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/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-wbr-element">HTML Standard <br><small># the-wbr-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>wbr</code></th>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">79</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-no">5.5–7</td>
+<td class="bc-supports-yes">11.6</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">12</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><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap"><code>overflow-wrap</code></a></li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/word-break"><code>word-break</code></a></li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens"><code>hyphens</code></a></li> <li>The <a href="br"><code>&lt;br&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/wbr" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr</a>
+ </p>
+</div>