Html css

Word Breaks Without Hypenation Using CSS

Posted by Weston Ganger on March 31, 2016

I had some post titles with long file path names that needed to be wrapped but I did not want it to break lines without hypenation or screw up the layout.

CSS has a simple rule for this:


.my-title{
  word-break: break-word; //non-standard but most supported
  word-wrap: break-word; //correct but less supported
}

Works like a charm.


Related External Links:


Posted in HTML / CSS and Tagged with css 


Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts