Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8466929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:29:26+00:00 2026-06-10T15:29:26+00:00

I am trying to word-wrap an email address within a div, where otherwise it

  • 0

I am trying to word-wrap an email address within a div, where otherwise it would overflow because it’s too long for the div’s width.

I know this issue has been covered here before (e.g. this question), but read-on, because I cover all the possible solutions mentioned there and elsewhere.

None of the below solutions do exactly what I want:

  1. CSS

    "word-wrap: break-word".
    

    Depending on the div’s width, this breaks the email address at awkward places. e.g.

    info@longemailaddress.co.u

    k

  2. Use a Soft Hyphen within the HTML:

    ­
    

    This is really well supported, but renders a visible hyphen on the page, leading user to believe the email address has a hyphen in there:

    info@long-

    emailaddress.co.uk

  3. Use a thinspace or zero-width space within the email address:

      (thinspace)
    ​ (zero-width space)
    

    Both of these insert extra characters (bummer if user copy-pastes)

  4. Linebreaks…

    <br />
    

    … are out because, most of the time, the div is large enough to contain the email address on one line.

I guess I’m hoping for some ingenious way of doing this in HTML/CSS, perhaps making use of pseudo elements (e.g. :before / :after), or by using a soft hyphen but somehow hiding it with CSS in some clever way.

My site uses jquery, so I’ll resort to that if I must, although I’d rather not include a whole hyphenation library just for this one little problem!

Answers on a postcard please. (Or, ideally here…)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:29:28+00:00Added an answer on June 10, 2026 at 3:29 pm

    You can clip the text and use a tooltip

       width: 100px;
       overflow: hidden;
       text-overflow: ellipsis;
    

    What I do is on hover show the full text as tooltip or use the title attribute for tooltip.

    <p class="email" title="long-email-address@mail.com">...</p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the CSS word-wrap property with break-word value. I want to
I am trying to wrap a word in a cell. The <td> has a
I am trying to extract a single word from a content editable div at
I'm trying to word wrap a richeditable text but I'm having some problems: I
I have been trying to get my EditText box to word wrap, but can't
I'm trying to define a vi 'map' command sequence, that would wrap the current
I have one long word... p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCx+wnDhlr7GqHiH6lAaPPuN5F7RjUrtvGyxxZkClJsLaTDeqg/FuJXU7RYdPQ2Ka++tfw0Z9+SRKatLUQQeCqLK8z1/V4p7BaJKPkegMzXgWGnFVmz1tdLFiYUGq0MvVgqWiepcTFmwgSd9g1pGRiCSDHJUDwcc+NidiW4/ixw4QIDAQAB ...that I am trying to fit in a
I'm trying to select each first word, to wrap it in a specific span.
I'm trying to create a word-wrap in JavaScript using CSS, and the condition is:
I am trying to word wrap a string into multiple lines. Every line will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.