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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:42:01+00:00 2026-05-15T02:42:01+00:00

I have one div with predefined width (say 80px), but the length of the

  • 0

I have one div with predefined width (say 80px), but the length of the content in the div can be long, can any body tell me how to increase the width of div based on content length?

my div looks like

    <div class="content">
Text here
</div>

I have tried to use jQuery to resize it, but I am always getting 0 value when I am using .width() or .innerWidth() functions.

Thanks
Ashwani

  • 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-15T02:42:02+00:00Added an answer on May 15, 2026 at 2:42 am

    Sounds like overkill to me. If possible, just modify the CSS from your div to:

    div.content {
       min-width:  80px;
       min-height: 80px;
    }
    

    That should ensure the div still expands dynamically if neccessary.

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

Sidebar

Related Questions

I have one content div with 960px of width and margin 0 auto (centralized),
I have website, usually all looks fine but sometimes one div is on the
So let's say i have one div and one image like this <div id=image_wrapper>
I have a div with class=tags with one predefined hyperlink. <div class=tags> <a href=#>myLink</a>
I have one div wrapping another like so <div id=container><div id=box></div></div> Let's say the
How can you have one div inside another? The inner div has to fit
i have one div and div has one img tag but image is not
i have one div which contains several divs. I changed the parent div width.
I am attempting to have one div hovering over another div full of content.
I have a situation where I have one div of fixed width, containing an

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.