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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:16:23+00:00 2026-05-30T15:16:23+00:00

I got a little problem with the div width. I show you an image

  • 0

I got a little problem with the div width.
I show you an image of what I have

Example
.

There is an outside div that has no specified width, it can be small or big.

On the right we got a image that floats on the right.

The text div contains a dynamic width that fills all the undefined width space. and inside a undefined width text.

What I want is that the overflow of the Text Div is hidden when the text width is more then the Text Div space.

The problem is how to specify a width to get the overflow on a dynamic width ?
If I don’t specify any width, the image will go under the text if it’s too long.

I hope I was clear enough.

Thank you for your help.

Edit:

Here is a bit of code to be more clear.

<div class="outside">
    <img src="img.jpg" class="img"/>
    <div class="text"><p>some text that is too long</p></div>
</div>

<style>
.img {
    float: right;
}
.text {
    float: left;
    overflow: hidden;
}
</style>

The problem is that .text doesn’t have any specific width, so the overflow doesn’t work

  • 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-30T15:16:25+00:00Added an answer on May 30, 2026 at 3:16 pm

    DEMO HERE

    so let me get this straight:

    • you want the text to be clipped when they overflow
    • however, you want to set limits using the div where it’s contained (which is dynamic)

    try this

    <div class="container">
        <img src="myimage.jpg" />
        <div class="flexi"> some long content</div>
    </div>
    
    img{
        float:right;
    }
    
    .container{
        overflow:hidden;
        zoom:1;
    }
    
    .flexi{
        white-space: nowrap;
        overflow:hidden;
        zoom:1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a little problem with repositioning a div that should serve as
I've got a little problem that's slightly frustrating. Is it possible to set a
I've almost got it finished. but there's a little problem in adding comments. I've
got a little problem im hoping someone can enlighten me on. Trying to serialise
I'm a starter with mysql and I have a little problem. I've got an
I got a little problem, what I think, can't be hard. but somehow, I
I've got a little problem as seen below: The cell has a background color,
I have got a little problem. I got a bxslider running on a website
I have got a little problem in IE8 with the nivoslider script and i
I've got a little problem with an exercise I have to finish. We have

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.