1

I want to utilize CSS3 Columns around my site as it on wide pages provides a better UX for the users. However if I use CSS3 Columns, sometimes the left column is full (lets say 20 lines of text) and the right side only have2 lines of text. Can I with pure css3 (maybe Flexbox) make it have equal amount of content? Or do I need JS to fix this?

Beaware I'm not talking about equal height, but equal amount of content :)

6
  • Wouldn't "equal amount of content" imply "equal height"? Commented Sep 22, 2014 at 11:46
  • @rnevius: no. If you Google "equal height" you only get results for divs in equal heights (backgrounds and such). I'm interested in "equal text/content". Commented Sep 22, 2014 at 11:51
  • you should consider using the twitter bootstrap framework or something similar. Commented Sep 22, 2014 at 12:31
  • @gldraphael: Why? Do they have a solution for this issue since you mention that framework? Commented Sep 22, 2014 at 13:45
  • @MortenHjort you don't need js for this - but please provide what you currently have - a sample case - I think I know what your problem is and I can make it work for you with CSS only. But need your code first. Commented Sep 22, 2014 at 14:35

2 Answers 2

1

You'll need to specify a height property.

From the Mozilla docs:

The CSS3 Column specification requires that the column heights must be balanced: that is, the browser automatically sets the maximum column height so that the heights of the content in each column are approximately equal.

However, in some situations it is also useful to set the maximum height of the columns explicitly, and then lay out content starting at the first column and creating as many columns as necessary, possibly overflowing to the right. Therefore, if the height is constrained, by setting the CSS height or max-height properties on a multi-column block, each column is allowed to grow to that height and no further before adding new column. This mode is also much more efficient for layout.

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

1 Comment

Thanks, but this wont work in a RWD-world. Only if all content and sizes are fixed.
0

Sorry it was a padding-bottom which messed it up. When I remove that it spreads out nicely. Strange!

Comments

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.