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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:53:15+00:00 2026-06-01T13:53:15+00:00

Basicly I want a text to resize depending how long the text is. If

  • 0

Basicly I want a text to resize depending how long the text is. If I wrote “WWWWWWWW” it would be resized to fit inside the 100px div.
If i wrote “Test” it wouldn’t be resized because it wont break the 100px limit.

I’m sure you get the idea by now.
I’m open for anything. Javascript, php, whatever you have to offer.

  • 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-01T13:53:17+00:00Added an answer on June 1, 2026 at 1:53 pm

    I think javascript is your friend here, as it allows you to best fit the text regardless of the user’s browser window size (if you do it in PHP and oversize/the layout will break for certain users).

    I had a similar issue, which made me write my own plugin for this. One solution is to use the shrink-to-fit-approach, as described here.
    However if you have to fit multiple items or are concerned with performance, e.g., on window resize, have a look at jquery-quickfit.

    It meassures and calculates a size invariant meassure for each letter of the text to fit and uses this to calculate the next best font-size which fits the text into the container.

    The calculations are cached, which makes it very fast (there is virtually no performance hit from the 2nd resize on forward) when dealing with multiple texts or having to fit a text multiple times, like e.g., on window resize.

    Demo for a similar situation as yours

    Further documentation, examples and source code are on the project page.

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

Sidebar

Related Questions

I have a issue with my listview, I basicly want the text in the
The code below basicly animates a div back and forth. Then I want the
Basicly, I want to write a C++ program and with it, pass messages to
hoping some one can shed some light on my problem. Basicly I only want
basicly I've got an array and want to call the same function for each
Basicaly I want JS to detect numbers and edit live any input on text
I want to rewrite the URL of a page in my website. Its basicly
Hard to explain.. I basicly want to do the following: var doWhat = speak;
I want my report to display results from two select statements. Basicly, one select
Basicaly I want to format a Date object using a specific pattern and the

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.