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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:03:20+00:00 2026-05-29T06:03:20+00:00

simplified, i have three elements A, B and C. B and C are together

  • 0

simplified, i have three elements A, B and C. B and C are together in a div. if there is enough horizontal space (browser window wide enough) i want them displayed as

A B C

trivial so far. if the window gets smaller, i want them to wrap like this:

A
B C

i solved this by giving the div a style.whiteSpace = "nowrap".
the problem is, that B C now simply wont wrap any more, even if there is not enough space to display them. when the window gets even smaller, i want this to be displayed as

A
B
C

so what i am looking for is kind of a softer version of ‘nowrap’ which prevents wrapping if there is room to evade to, but allows wrapping if not.

EDIT:

a reply solved the above by making everything float: http://jsfiddle.net/nF4k5/6/

this made me realize that my simplification went too far. actually in my application A is a text and has wrapping in itself, so will sometimes fill the whole width. B and C can be imagined as single words that should appear
a) together in the last line of text A or if they wont fit there together
b) on a new line or if that line is too short
c) on two lines.

i made an example to play around with: http://jsfiddle.net/nF4k5/5/

ever smaller screens should result in:

A A A A B C

A A A A
B C

A A A
A B C

A A
A A
B C

A
A
A
A
B
C

it would be especially nice if the solution didnt involve making changes to A, like my adding of nowrap to the div around B C, which doesnt work.

EDIT:
solution: instead of giving the wrapper of B and C a whiteSpace=”nowrap” i give it a display=”inline-block”.

  • 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-29T06:03:21+00:00Added an answer on May 29, 2026 at 6:03 am

    put A in div X , B and C in Y. Float X and Y to left.
    Whenever width is smaller than width of X+Y, Y will go down.

    Inside Y : put B in div sonOfX, put C in sonOfY, Float sonOfX and sonOfY to left.
    Whenever width is smaller than width of sonOfX+sonOfY , sonOfY will go down.

    here you go – http://jsfiddle.net/nF4k5/

    This should do it: http://jsfiddle.net/nF4k5/7/ for your new question

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

Sidebar

Related Questions

I have a (simplified) table consisting of three columns: id INT PRIMARY KEY NOT
I have a Grid that looks something like the simplified example showed below. There
I have the following, simplified, code: <div id=content> <p>text</p> <div id=container> <div id=col1> <p>text</p>
I have a linq to sql database. Very simplified we have 3 tables, Projects
I have the following methods in an enum helper class (I have simplified it
I have models (simplified example): class Group(models.Model): name = models.CharField(max_length = 32) class Person(models.Model):
I have a simplified ajay script, from which I have removed all nonrelevant code.
Names and objects have been simplified for clarity's sake. The basic concept remains the
Let's consider following, simplified example: We have 2 tabs withing <rich:tabPanel switchType=ajax> , each
I have following situation (simplified, of course): MyDomain.groovy: class MyDomain { MyAnotherDomain anotherDomain //

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.