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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:01:37+00:00 2026-05-14T00:01:37+00:00

Imagine I have the following code (simplified regarding my real context of course): <div

  • 0

Imagine I have the following code (simplified regarding my real context of course):

<div id="box" style="width: 120px;" onmouseover="this.style.width='200px'" onmouseout="this.style.width='120px'">
    <div>A label</div>
    <div>Another label</div>
    <div>Another label, but a longer label</div>
</div>

What I want to achieve is the following:

My div box has a fixed width (120px by default).
In this configuration, every label nested in the box must be written in a single line.
If the text is too long, then the overflow must be hidden.

In my example, the third item will be displayed Another label, but a or Another label, but a ....

When the cursor is entering the div box, the width of the box is modified (for example to 200px).
In this configuration, the labels that were shorten in the first configuration are now displayed in the whole space.

With my code snippet, the third label is displayed in two lines when the box has a 120px, and I do not want that…

How can I achieve that?

Note that I would be great if the solution works also for IE6!

Even if I prefer a pure CSS/HTML solution, (simple) Javascript (and jQuery) is allowed!

  • 1 1 Answer
  • 1 View
  • 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-14T00:01:37+00:00Added an answer on May 14, 2026 at 12:01 am

    style=”white-space:nowrap; overflow:hidden;”

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

Sidebar

Related Questions

Imagine you have two views with code like the following: controller_a/a.html.erb <%= content_tag(:div) do
I have the following, simplified, code: <div id=content> <p>text</p> <div id=container> <div id=col1> <p>text</p>
Imagine that i have the following code: <a:repeat value=#{bean.getList()} var=x > <li class=la> <span>
I came across the following weird chunk of code.Imagine you have the following typedef:
I have a question about jQuery load best practice. Imagine the following situation: $(#div).on('click',
Imagine we have 2 files, one called 1.php with the following code: <?php $hello
Imagine I have the following, standard WCF, code : [ServiceContract] interface ICustomerService { [OperationContract]
Imagine we have following PHP code: if (true) { doSomething(); } But we want
Imagine I have the following code: class A { [UsefulAttribute(foo)] B var1; [UsefulAttribute(bar)] B
Imagine I have the following code that runs as a background processor for 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.