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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:18:29+00:00 2026-06-10T09:18:29+00:00

I have the following layout in mind for a list. Each list item is

  • 0

I have the following layout in mind for a list. Each list item is represented by two columns. The second column should take up all available space, but it should be anchored to the right with its minimum size if the first column is taking up too much space. The first column should then show an ellipsis.

The problem is happening in that last case. When the first column consists of too much text, instead of showing an ellipsis, it stretches itself out of the flexbox causing an horizontal scrollbar to appear, and the second column is not anchored to the right.

I would like to have it rendered like this (mockup):

Expected rendering

How can I achieve that?

This is sample fiddle .

.container {
    display: -webkit-flex;
}

div {
    white-space: nowrap;
    text-overflow: ellipsis;
}

.container > div:last-child {
    -webkit-flex: 1;
    background: red;
}
<!-- a small first column; the second column is taking up space as expected -->
<div class="container">
    <div>foo barfoo bar</div>
    <div>foo bar</div>
</div>

<!-- a large first column; the first column is overflowing out of the flexbox container -->
<div class="container">
    <div>foo barfoo barfoo barfoo barfoo barfoo barfoo bar
    foo barfoo barfoo barfoo barfoo barfoo barfoo bar
    foo barfoo barfoo barfoo barfoo barfoo barfoo bar</div>
    <div>foo bar</div>
</div>
  • 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-06-10T09:18:31+00:00Added an answer on June 10, 2026 at 9:18 am

    UPDATE

    Adding code that works:

    .container {
        display: -webkit-flex; 
    }
    
    .container>div:first-child{
        white-space:nowrap;
       -webkit-order:1;
       -webkit-flex: 0 1 auto; /*important*/
        text-overflow: ellipsis;
        overflow:hidden;
        min-width:0; /* new algorithm overrides the width calculation */
    }
    
    .container > div:last-child {
        -webkit-flex: 1;
        -webkit-order:2;
        background: red;
        -webkit-flex:1 0 auto; /*important*/
    }
    .container > div:first-child:hover{
        white-space:normal;
    }
    <div class="container">
        <div>foo barfoo bar</div>
        <div>foo bar</div>
    </div>
    
    <div class="container">
            <div>foo barfoo barfoo barfoo barfoo barfoo barfoo bar
            foo barfoo barfoo barfoo barfoo barfoo barfoo bar
            foo barfoo barfoo barfoo barfoo barfoo barfoo bar</div>
        <div>foo bar</div>
    </div>
    <div class="container">
        <div>foo barfoo bar</div>
        <div>foo bar</div>
    </div>
    
    <div class="container">
            <div>foo barfoo barfoo barfoo barfoo barfoo barfoo bar
            foo barfoo barfoo barfoo barfoo barfoo barfoo bar
            foo barfoo barfoo barfoo barfoo barfoo barfoo bar</div>
        <div>foo bar</div>
    </div><div class="container">
        <div>foo barfoo bar</div>
        <div>foo bar</div>
    </div>

    Original answer / explanation.

    W3C specification says, “By default, flex items won’t shrink below their minimum content size (the length of the longest word or fixed-size element). To change this, set the ‘min-width’ or ‘min-height’ property.“

    If we follow this line of reasoning, I believe the bug has been removed from Canary, not the other way round.

    Check as soon as I put min-width to 0, it works in Canary.

    So bug was in older implementations, and canary removes that bug.

    This example is working in canary. http://jsfiddle.net/iamanubhavsaini/zWtBu/

    I used Google Chrome Version 23.0.1245.0 canary.

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

Sidebar

Related Questions

I have the following layout in my page (simplified) <h:form> <h:commandButton action=#{bean.save} value=Save/> <rich:tabPanel
I have the following layout for my mvc project: /Controllers /Demo /Demo/DemoArea1Controller /Demo/DemoArea2Controller etc...
I have the following layout defined for one of my Activities: <?xml version=1.0 encoding=utf-8?>
I have the following layout : And following code : public class MailSenderActivity extends
I have the following layout: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:background=@drawable/aussie_bg_big > <ImageView android:id=@+id/titleImage android:layout_width=wrap_content
I have the following XML layout for a ListActivity. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following XML layout file, HELPME.XML <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
This is maddening. I have the following XML layout: <FrameLayout android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/shadow android:focusable=true
I have created the following database layout, and started coding the application. The more
I have following layout: <h:body> <p:outputPanel layout=block id=page style=width:100%;height:100%;> <h:panelGroup layout=block> <p:layout fullPage=true> <p:layoutUnit

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.