Word-wrap:break-word in 100% table-cell - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Table Cell

Description

Word-wrap:break-word in 100% table-cell

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">
body {<!--   w ww . j  a  v a  2 s .c o  m-->
   margin:0
}

#a {
   display:table;
   width:81%;
   margin:0 auto
}

#b {
   display:table-cell;
   background-color:Chartreuse;
}

#c {
   display:table-cell;
   width:100%;
   background-color:yellow;
   *word-break:break-all;
   word-break:break-word;
   -moz-hyphens:auto;
   -ms-hyphens:auto;
   hyphens:auto;
}
</style> 
 </head> 
 <body> 
  <div id="a" lang="en"> 
   <div id="b"> 
    <img src="https://www.java2s.com/style/demo/Opera.png"> 
   </div> 
   <div id="c">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor i 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials