<wbr> - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:wbr

Introduction

wbr marks for a Safe Line Break.

The wbr element is new to HTML5 and hints where the browser could insert a line break to wrap content.

The browser would decide when to add a line break.

The wbr element just marks suitable places to break content.

With the wbr element, the browser is able to treat the very long word as a series of smaller segments.

The wbr element are telling the browser where breaking a word would be most appropriate.

The wbr Element summary

Item Value
Elementwbr
Local Attributes None
Contents N/A
Tag Style Void
New in HTML5 Yes
Changes in HTML5 N/A
Style Convention Display subsequent content on a new line when wrapping content is required

The following code shows the use of the wbr element to help the browser display a long word.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <title>Example</title> 
   </head> 
   <body>
       This is a very long word: Super
      <wbr>
      asdfadfasdfasdfasdfadfasdfadsfasdfasdfasfdasdfasdf
      <wbr>
      asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf. We can help the browser display long words with the 
      <code>wbr</code>
       element.  <!--from   ww w  .  ja  v a 2  s . co  m-->
   </body>
</html>

Related Tutorials