diff options
Diffstat (limited to 'devdocs/html/element%2Fwbr.html')
| -rw-r--r-- | devdocs/html/element%2Fwbr.html | 78 |
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><wbr>: The Line Break Opportunity element</h1></header><div class="section-content"><p>The <code><wbr></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><wbr></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><div dir=rtl>123,<wbr>456</div></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><wbr></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>&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"><</span>p</span><span class="token punctuation">></span></span> + http://this<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>.is<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>.a<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>.really<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>.long<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>.example<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>.com/With<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/pages<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/pages<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/pages<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/pages<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/deeper<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/level<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>wbr</span> <span class="token punctuation">/></span></span>/pages +<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>p</span><span class="token punctuation">></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><br></code></a> element</li> </ul></div><div class="_attribution"> + <p class="_attribution-p"> + © 2005–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> |
