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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:52:51+00:00 2026-05-26T07:52:51+00:00

Consider the following HTML: <div class=’x’> <ul> <li>Number one</li> <li>Number two</li> <li>Number three</li> <li>Number

  • 0

Consider the following HTML:

<div class='x'>
    <ul>
        <li>Number one</li>
        <li>Number two</li>
        <li>Number three</li>
        <li>Number four is a bit longer</li>
        <li>Number five</li>
    </ul>
</div>

and the following CSS:

.x {
    -moz-column-count: 3;
    column-count: 3;
    width: 30em;
}

As it stands, Firefox currently renders this similarly to the following:

• Number one    • Number three          bit longer
• Number two    • Number four is a    • Number five

Notice that the fourth item was split between the second and third column. How do I prevent that?

The desired rendering might look something more like:

• Number one    • Number four is a
• Number two      bit longer
• Number three  • Number five

or

• Number one    • Number three        • Number five
• Number two    • Number four is a
                  bit longer

Edit: The width is only specified to demonstrate the unwanted rendering. In the real case, of course there is no fixed width.

  • 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-26T07:52:52+00:00Added an answer on May 26, 2026 at 7:52 am

    The correct way to do this is with the break-inside CSS property:

    .x li {
        break-inside: avoid-column;
    }
    

    Unfortunately, as of October 2021, this is still not supported in Firefox but it is supported by every other major browser. With Chrome, I was able to use the above code, but I couldn’t make anything work for Firefox (See Bug 549114).

    The workaround you can do for Firefox if necessary is to wrap your non-breaking content in a table but that is a really, really terrible solution if you can avoid it.

    UPDATE

    According to the bug report mentioned above, Firefox 20+ supports page-break-inside: avoid as a mechanism for avoiding column breaks inside an element but the below code snippet demonstrates it still not working with lists:

    .x {
        column-count: 3;
        width: 30em;
    }
    
    .x ul {
        margin: 0;
    }
    
    .x li {
        -webkit-column-break-inside: avoid;
        -moz-column-break-inside:avoid;
        -moz-page-break-inside:avoid;
        page-break-inside: avoid;
        break-inside: avoid-column;
    }
    <div class='x'>
        <ul>
            <li>Number one, one, one, one, one</li>
            <li>Number two, two, two, two, two, two, two, two, two, two, two, two</li>
            <li>Number three</li>
        </ul>
    </div>

    As others mention, you can do overflow: hidden or display: inline-block but this removes the bullets shown in the original question. Your solution will vary based on what your goals are.

    UPDATE 2 Since Firefox does prevent breaking on display:table and display:inline-block a reliable but non-semantic solution would be to wrap each list item in its own list and apply the style rule there:

    .x {
        -moz-column-count: 3;
        -webkit-column-count: 3;
        column-count: 3;
        width: 30em;
    }
    
    .x ul {
        margin: 0;
        page-break-inside: avoid;           /* Theoretically FF 20+ */
        break-inside: avoid-column;         /* Chrome, Safari, IE 11 */
        display:table;                      /* Actually FF 20+ */
    }
    <div class='x'>
        <ul>
            <li>Number one, one, one, one, one</li>
        </ul>
        <ul>
            <li>Number two, two, two, two, two, two, two, two, two, two, two, two</li>
        </ul>
        <ul>
            <li>Number three</li>
        </ul>
    </div>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following Html: <div class=one> <span>1. test</span> <span>test</span> </div> <div class=two> <span>2. test</span><span>test</span>
Consider the following HTML : <div class=list> <select> <option value=one>1</option> <option value=two>2</option> </select> And
Consider the following code : HTML: <div class='a'></div> <div class='b'></div> CSS: body { position:
Consider the following code : HTML: <div id='button' class='enabled'>Press here</div> <div id='log'></div> CSS: #button
Consider the following code: $(document).ready(function() { $(body).append(<div class='outer'><span class='inner'>Click me</span></div>); $(html).click(function(event) { var targetClass
Consider the following: HTML <div class=info_bubble> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Consider the following HTML/css code sample: <div id="container"> <div id="up">Text<br />Text<br />Text<br /></div> <div
Consider the following HTML snipped: <input type=submit value=Delete selected><input type=submit value=Print selected> <div class=table>
Consider the following example: ( live demo here ) HTML: <div class=board> <div class=row>
Consider the following html: <div class=image> <img src=sample.png/> <div class=text> Text of variable length

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.