)

Forcing Breaks, Hyphenation, Ellipsis on Long Words and URLs

Last Updated: 3 years ago by BrodNeil

This usually comes handy when URLs overflow in mobile devices.

Replace .dont-break-out with the element in use.

/*------------------------------------*\
Forcing Breaks, Hyphenation, Ellipsis
\*------------------------------------*/

.dont-break-out {

  /* These are technically the same, but use both */
  overflow-wrap: break-word;
  word-wrap: break-word;

  -ms-word-break: break-all;
  /* This is the dangerous one in WebKit, as it breaks things wherever */
  word-break: break-all;
  /* Instead use this non-standard one: */
  word-break: break-word;

  /* Adds a hyphen where the word breaks, if supported (No Blink) */
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;

}

Before (mobile version)

overflow before 1

After (mobile version)

overflow after 2

Thanks to https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/

Recommendations

  • SimpleTraffic - drives real visitors to your website, blog, or affiliate link. Get started with 2500 free visitors on your 5 day free trial!
  • BrandPush - gets you featured on 200+ news sites. Go viral with massive exposure like Daily Herald, Newsmax, Fox News, etc.!
  • MediaServe - is a web hosting service that values free speech, providing content policies and support aligned with these values. It is also known as the web hosting for conservatives.
  • Leaver - is a web hosting service tailored for conservatives, providing content policies and support aligned with conservative values --- conservative web hosting.
  • Nitropack - Unleash lightning-fast website performance like never before! Get your FREE account now!
  • RankMath - the SEO plugin you should try for easy and practical use
  • WordHero.co - Effortlessly produce AI-enhanced content with a single click.
  • Fokas Beyond: Stock Market Course - Click to watch the masterclass. Register Now for FREE!
  • Creately - replaces your Visual Collaboration, Whiteboarding, Diagramming tools with more power and capability. Try the FREE plan!
  • Copymatic.ai - Instantly produce compelling copy and stunning images
  • ContentatScale.ai - Publish high-ranking content… instantly.
  • Catering Services in Cebu - Food catering services provider in Cebu Philippines.
  • Ngohiong - order now at P150 (around $3) per pack of 10 pieces.

Discover more tools - See our recommended tools, software, and services.