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 501401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:11:09+00:00 2026-05-13T06:11:09+00:00

This is my coding. The result of using css as class Hyphenate, the result

  • 0

This is my coding.
The result of using css as class Hyphenate, the result is shows in result1.
However, what I want is the result shows in result2.
Also, in result1, when there are just few words, it gives wide gap between words, it’s really ugly.
Is anyone now how to solve this problem?

–edit question–

What I am asking here is: I have a textarea for the input and div tag for the result.
What is the way so that whenever there’s a word that reaches the right bound, the word is break into a new line, but, the goal is just like what is shows by result 2.
Hopefully anyone can understand now. Thanks.

Div tag has width=170px which

.hyphenate{ 
    text-wrap: suppress; 
    word-break: break-all; 
    word-wrap: break-word; 
    white-space: -moz-pre-wrap; 
    white-space: pre-wrap; 
    white-space: -o-pre-wrap; 
    white-space: pre-line; 
    width:170px; 
    text-align:justify; 
}

–

<script type="text/javascript">
    function copyIt() {
        var x = document.getElementById("textarea").value;
        document.getElementById("result1").innerHTML = x;
    }
</script>

–

<table border=2 width="160"> 
    <tr>
        <td colspan=2>
            <h1>Hyphenator Tester</h1> 
        </td>
    </tr> 
    <tr> 
        <td width="160" valign="top"> 
            <textarea id="textarea" rows=5 cols=20 onkeyup="copyIt()">
                This is the preview of something What
            </textarea> 
            <br><br>Result:<br>
            <div id="result1" class="hyphenate"> 
                This is the preview of something what I've wrote earlier
            </div>
            <br>Result wanted:<br>
            <div id="result2" class="hyphenate">
                This is the preview of some- thing what I've wrote earlier
            </div> 
        </td>
    </tr> 
</table>
  • 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-05-13T06:11:10+00:00Added an answer on May 13, 2026 at 6:11 am

    Try Hyphenator.js.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just a question... I'm seeing this coding style in various php scripts
My friend done this below coding for custom control <a href=javascript:__doPostBack('id','msg');>click</a> now i want
Mine is this: Hard coding is the way! All my problems go away. Just
This is specifically related to ARM Neon SIMD coding. I am using ARM Neon
Just to lay down some restrictions first. Because of the environment I'm coding this
I've been using the coding from an example from this link : The code
Context We have this application, using about 60 coding projects. We have several products
This is a strange question because I already know the 'coding' answer. I just
Can anyone notice an error in this coding??? NSString *textFilePath = [[NSBundle mainBundle] pathForResource:@test
I'm trying to use this coding but its not processing, and its not outputing

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.