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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:41:31+00:00 2026-05-24T12:41:31+00:00

How can I force .b to shrink to fit next to .a without using

  • 0

How can I force .b to shrink to fit next to .a without using tables and without .b wrapping? .a should always display in full.

css:

div{
    width:150px;
    border:1px solid #000;
    overflow:hidden;
}
.a{
    float:right
}

.b{
    float:left;
    overflow:hidden;
    white-space:nowrap;
}

html:

<div><span class='a'>a - text</span><span class='b'>b - some really long text and stuff</span></div>

jsfiddle: http://jsfiddle.net/jcubed111/U56cq/

  • 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-24T12:41:31+00:00Added an answer on May 24, 2026 at 12:41 pm

    http://jsfiddle.net/U56cq/16/

    Replace float:left with display:block and you’d get what you want. The point is: block in normal flow with overflow:hidden next to block with float would shrink exactly to fit in a space near the floated block.

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

Sidebar

Related Questions

Is there any way I can force a floated div to shrink instead of
Using Castle ActiveRecord / NHibernate: Is there a way you can force an ICriterion
How can I force validation when user clicks button? One would think this should
How can I force a shrink of a DataTable and/or List so that I
Is there any way that I can use just HMTL and CSS to force
Is there any way I can force soft keyboard to appear in full screen
On Visual studio I can force use of 32-bit time_t by declaring _USE_32BIT_TIME_T .
I was wondering how i can force a user who has requested a page
Does anyone know how I can force CanExecute to get called on a custom
Okay, I've got my normal app which is in portrait mode. I can force

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.