: The Line Break Opportunity Element - HTML - MDN Web Docs
Có thể bạn quan tâm
- References
- HTML
- Elements
- <wbr>
- English (US)
- Remember language
- Deutsch
- Español
- Français
- 日本語
- 한국어
- Português (do Brasil)
- Русский
- 中文 (简体)
- 正體中文 (繁體)
- Try it
- Attributes
- Notes
- Examples
- Technical summary
- Specifications
- Browser compatibility
- See also
- HTML
- Tutorials
- HTML basics
- Introduction to HTML
- Introduction to HTML overview
- Getting started with HTML
- What's in the head? Metadata in HTML
- HTML text fundamentals
- Creating hyperlinks
- Advanced text formatting
- Document and website structure
- Debugging HTML
- Assessment: Marking up a letter
- Assessment: Structuring a page of content
- Multimedia and embedding
- Multimedia and embedding overview
- Images in HTML
- Video and audio content
- From object to iframe — other embedding technologies
- Adding vector graphics to the web
- Responsive images
- Assessment: Mozilla splash page
- HTML tables
- HTML tables overview
- HTML table basics
- HTML table advanced features and accessibility
- Assessment: Structuring planet data
- References
- HTML elements
- <a>
- <abbr>
- <acronym> Deprecated
- <address>
- <area>
- <article>
- <aside>
- <audio>
- <b>
- <base>
- <bdi>
- <bdo>
- <big> Deprecated
- <blockquote>
- <body>
- <br>
- <button>
- <canvas>
- <caption>
- <center> Deprecated
- <cite>
- <code>
- <col>
- <colgroup>
- <data>
- <datalist>
- <dd>
- <del>
- <details>
- <dfn>
- <dialog>
- <dir> Deprecated
- <div>
- <dl>
- <dt>
- <em>
- <embed>
- <fencedframe> Experimental
- <fieldset>
- <figcaption>
- <figure>
- <font> Deprecated
- <footer>
- <form>
- <frame> Deprecated
- <frameset> Deprecated
- <h1>
- <head>
- <header>
- <hgroup>
- <hr>
- <html>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <kbd>
- <label>
- <legend>
- <li>
- <link>
- <main>
- <map>
- <mark>
- <marquee> Deprecated
- <menu>
- <meta>
- <meter>
- <nav>
- <nobr> Deprecated
- <noembed> Deprecated
- <noframes> Deprecated
- <noscript>
- <object>
- <ol>
- <optgroup>
- <option>
- <output>
- <p>
- <param> Deprecated
- <picture>
- <plaintext> Deprecated
- <portal> Experimental
- <pre>
- <progress>
- <q>
- <rb> Deprecated
- <rp>
- <rt>
- <rtc> Deprecated
- <ruby>
- <s>
- <samp>
- <script>
- <search>
- <section>
- <select>
- <slot>
- <small>
- <source>
- <span>
- <strike> Deprecated
- <strong>
- <style>
- <sub>
- <summary>
- <sup>
- <table>
- <tbody>
- <td>
- <template>
- <textarea>
- <tfoot>
- <th>
- <thead>
- <time>
- <title>
- <tr>
- <track>
- <tt> Deprecated
- <u>
- <ul>
- <var>
- <video>
- <wbr>
- <xmp> Deprecated
- Global attributes
- accesskey
- anchor Experimental Non-standard
- autocapitalize
- autocorrect Experimental
- autofocus
- class
- contenteditable
- data-*
- dir
- draggable
- enterkeyhint
- exportparts
- hidden
- id
- inert
- inputmode
- is
- itemid
- itemprop
- itemref
- itemscope
- itemtype
- lang
- nonce
- part
- popover
- slot
- spellcheck
- style
- tabindex
- title
- translate
- virtualkeyboardpolicy Experimental
- writingsuggestions
- Attributes
- accept
- autocomplete
- capture
- crossorigin
- dirname
- disabled
- elementtiming
- for
- max
- maxlength
- min
- minlength
- multiple
- pattern
- placeholder
- readonly
- rel
- required
- size
- step
- <input> types
- <input type="button">
- <input type="checkbox">
- <input type="color">
- <input type="date">
- <input type="datetime-local">
- <input type="email">
- <input type="file">
- <input type="hidden">
- <input type="image">
- <input type="month">
- <input type="number">
- <input type="password">
- <input type="radio">
- <input type="range">
- <input type="reset">
- <input type="search">
- <input type="submit">
- <input type="tel">
- <input type="text">
- <input type="time">
- <input type="url">
- <input type="week">
- Guides
-
- Content categories
- Block-level elements
- Inline elements
- Quirks Mode and Standards Mode
- Date and time formats used in HTML
- Constraint validation
- Microdata
- Microformats
- Viewport meta tag
- Allowing cross-origin use of images and canvas
- Try it
- Attributes
- Notes
- Examples
- Technical summary
- Specifications
- Browser compatibility
- See also
The <wbr> HTML 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.
Try it
Attributes
This element only includes the global attributes.
Notes
On UTF-8 encoded pages, <wbr> behaves like the U+200B ZERO-WIDTH SPACE code point. In particular, it behaves like a Unicode bidi BN code point, meaning it has no effect on bidi-ordering: <div dir=rtl>123,<wbr>456</div> displays, when not broken on two lines, 123,456 and not 456,123.
For the same reason, the <wbr> 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 (­) instead.
Examples
The Yahoo Style Guide recommends breaking a URL before punctuation, to avoid leaving a punctuation mark at the end of the line, which the reader might mistake for the end of the URL.
html<p> http://this<wbr />.is<wbr />.a<wbr />.really<wbr />.long<wbr />.example<wbr />.com/With<wbr />/deeper<wbr />/level<wbr />/pages<wbr />/deeper<wbr />/level<wbr />/pages<wbr />/deeper<wbr />/level<wbr />/pages<wbr />/deeper<wbr />/level<wbr />/pages<wbr />/deeper<wbr />/level<wbr />/pages </p>Result
Technical summary
Content categories | Flow content, phrasing content. |
---|---|
Permitted content | Empty |
Tag omission | Must have a start tag and must not have an end tag. |
Permitted parents | Any element that accepts phrasing content. |
Implicit ARIA role | No corresponding role |
Permitted ARIA roles | Any |
DOM interface | HTMLElement |
Specifications
Specification |
---|
HTML Standard # the-wbr-element |
Browser compatibility
BCD tables only load in the browser
See also
- overflow-wrap
- word-break
- hyphens
- The <br> element
Help improve MDN
Was this page helpful to you?YesNoLearn how to contribute.This page was last modified on Mar 14, 2024 by MDN contributors.
View this page on GitHub • Report a problem with this contentTừ khóa » Html Br Alternatives
-
What Is The Alternative To
If I Want To Control The Height Between ... -
What Is The Best Alternative To Repetitive Typing Of
Tags In HTML ... -
How To Break Line Without Using
Tag In HTML / CSS -
Alternative To BR TAG | Learn HTML CSS - YouTube
-
How To Break Line Without Using
Tag In CSS - W3docs -
What To Use Instead Of
- HTML Forum At WebmasterWorld -
Tag Alternatives? - Web Hosting Talk -
Alternative To
Inside- - HTML & CSS - SitePoint Forums
-
[Solved] Spacing Text In CSS, Alternatives To The BR Tag
-
The Centered Text Element - HTML: HyperText Markup Language
-
Search Code Snippets | Alternative Br Tag Css
-
Br Alternative Tag In Html Code Example - Newbedev
-
HTML Pre Tag - W3Schools
-
4.6. Precise Spacing And Layout - HTML & XHTML - O'Reilly