0

I have a div with column-count set to 3. Inside are a number of uls. I am seeing the beginnings of a 4th column on the right side - why would this show up when I've specified 3 columns?

Screenshot

HTML (Fiddle here: http://jsfiddle.net/B6zDR/3/)

<!DOCTYPE html>

<html>
    <head>
        <title></title>
        <style type="text/css">
            div
            {
                height: 150px;
                width: 835px;
                padding: 20px;
                overflow: hidden;
                text-overflow: ellipsis;
                -moz-column-count: 3;
                -webkit-column-count: 3;
                column-count: 3;
                background-color: lightblue;
            }

            h2
            {
                margin: 0;
            }
        </style>
    </head>
    <body>
        <div>
            <h2>UL #1</h2>
            <ul>
                <li>1</li>
                <li>2</li>
            </ul>
            <h2>UL #2</h2>
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
                <li>5</li>
                <li>6</li>
            </ul>
            <h2>UL #3</h2>
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
                <li>5</li>
            </ul>
            <h2>UL #4</h2>
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
                <li>5</li>
            </ul>
            <h2>UL #5</h2>
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
                <li>4</li>
                <li>5</li>
            </ul>
        </div>
    </body>
</html>
3
  • 1
    I think your fiddle has the HTML in the wrong place sir! Commented Dec 14, 2012 at 19:19
  • Whoops, pasted link to wrong version! jsfiddle.net/B6zDR/3 Commented Dec 14, 2012 at 19:29
  • 1
    What browser are you seeing this under? Commented Dec 14, 2012 at 19:31

2 Answers 2

2

The only thing that can override a column-count declaration is the height declaration. In your example, your are limiting the height of the div element, but specifying a 3 columns layout. Therefore, your div is trying to force a 3 column layout, runs out of space, and overflows to the right.

Check out "Test #6" on http://www.quirksmode.org/css/multicolumn.html

Sign up to request clarification or add additional context in comments.

1 Comment

Hmm, I see. It would be cool if there was a way to say "3 columns - hide the rest." That's what I'm going for here...maybe an ellipsis. But I can't get that to happen.
1

Okay, so this is just a guess so keep that in mind.

Since changing the HTML 5 column-count attribute does not change anything in Firefox 17 but moz-column-count does, that would seem to imply that it is still in development phase. This could very well be a bug.

1 Comment

Yes, agreed it could be a bug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.