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

  • Home
  • SEARCH
  • 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 401119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:00:17+00:00 2026-05-12T17:00:17+00:00

I am new to javascript, so excuse my lack of actual code. I have

  • 0

I am new to javascript, so excuse my lack of actual code.

I have a block of text that I want to fit into a space. I want to break it into rows. I need to find where the newlines are to add a new line and some offset. Then I want to subtract the offset from the row word length (if needed) and get a new cycle until there is something to do.

I was actually hoping to get an answer on the splitting on newlines, or at least finding out how long a row is by pixels.

  • 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-12T17:00:18+00:00Added an answer on May 12, 2026 at 5:00 pm

    Why not use the element offset?

    <div id="somediv" style="height:20px;width:100px;">
     some content that wrap and makes new line  some content that wrap and makes new line  some content that wrap and makes new line  some content that wrap and makes new line 
    </div>
    
    <script>
        var d=document.getElementById("somediv");
        alert(d.style.height);//outputs 20px
        alert(d.offsetHeight);//outputs the actual/rendered height used by the element
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was checking out HTML5 new javascript commands and there is something similar to:
What is the benefit of the new Javascript OData library over using jQuery? http://blogs.msdn.com/b/astoriateam/archive/2011/02/08/new-javascript-library-for-odata-and-beyond.aspx
I have an Ajax request that comes in to update part of the webpage.
If JavaScript (new Date()).getTime() is run from 2 different timezones simultaneously, will you get
Hi I don't know whether this is my mistake in understanding Javascript prototype object
I've been reading up on Mozilla's continuing development of JavaScript, up through version 1.8.5:
I am developing a tab based Facebook application that lets the users add custom
Ive got a method which will copy a section of html to the clipboard
since yesterday is my app not rendering the xfbml Tags (name and picture). Iam
On my site http://colnect.com I've implemented the Facebook login button and on some pages

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.