Break all text inside span - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Text

Description

Break all text inside span

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#main {<!-- ww  w  . j  av  a 2  s  .c om-->
   border:2px solid Chartreuse;
   width:100px;
}

.wrapper {
   display:inline-block;
}

span {
   display:block;
   word-break:break-all;
}
</style> 
 </head> 
 <body> 
  <div id="main"> 
   <p class="wrapper"> <span>foo1</span> <span>foo2</span> <span>loooooooooooooooong foooooooooooooooooooo</span> </p> 
  </div>  
 </body>
</html>

Related Tutorials