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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:59:06+00:00 2026-06-16T02:59:06+00:00

Is it possible to shorten a container (preferably div) so that the dynamically inserted

  • 0

Is it possible to shorten a container (preferably div) so that the dynamically inserted text within becomes a “perfect” rectangle without increasing the height?

<div style="width:800px;">
<div>I'd like these words to look like below, but I'd like to "automatically" set it with a few lines of CSS rather than with jQuery or some other computationally intensive alternative.</div>
</div>
<br>
<div style="width:800px;">
<div style="width:530px;">I'd like these words to look like below, but I'd like to "automatically" set it with a few lines of CSS rather than with jQuery or some other computationally intensive alternative.</div>
</div>​

http://jsfiddle.net/Q7gcb/

I’d like to do this with a single CSS setting if possible, but I can’t find one. I’d also like to avoid a loop in javascript to do this because I have to do this to a lot of divs, and I don’t want performance to suffer.

white-space doesn’t seem to help unless if I’m using it wrong.

Many thanks in advance!

text-align:justify;

By itself doesn’t help: http://jsfiddle.net/Q7gcb/4/

max-width + text-align:justify;

Doesn’t work either: http://jsfiddle.net/Q7gcb/5/

  • 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-16T02:59:07+00:00Added an answer on June 16, 2026 at 2:59 am

    I believe that what you are looking for can be found Here

    “In DTP and word processing applications, this option is known as ‘force justify’. Unfortunately, this is not an option in CSS.”

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

Sidebar

Related Questions

Is it possible to shorten a group by clause so that you do not
Is this possible, or am I just trying to way overly shorten my code?
Is it possible to get the this that a function's caller was called with
Is it possible to shorten commands, such as... this.ExampleCommand1.ExampleCommand2.1; this.ExampleCommand1.ExampleCommand2.2; this.ExampleCommand1.ExampleCommand2.3; to ExampleShorten =
Is it possible to shorten the following function to a lambda expression? Or (to
Is it possible to somehow shorten this code: var i=GetStringFromServer('/url'); if(i){ $('#Div1').hide(); $('#Div2').show(); }
I'm just trying to shorten a line of code that assigns HTML::Element->as_trimmed_text from an
I tend to obsess about expressing code the most compactly and succinctly possible without
I have a cluttery piece of code that I would like to shorten using
Possible Duplicate: Shorten String in PHP (full words only) How to get first x

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.