Why is my multi-column spacing not working in Chrome?

harriyott picture harriyott · Nov 1, 2012 · Viewed 9.2k times · Source

My CSS columns are displaying differently in Chrome from how they're displaying in Firefox and IE9. This is the correct display in Firefox:

Columns in Firefox

Here's how it displays incorrectly in Chrome:

Columns in Chrome

I've tried changing the li to display: inline-block, which is an improvement of sorts in Chrome, but then the narrower list items appear in the same "cell".

I've made a JSFiddle to demonstrate the problem.

Answer

Deborah picture Deborah · Apr 10, 2013

Give both the parent element (in the example, it's the body tag) and the "results" div a CSS style of position: relative. (Also, remove the position:absolute from the .results CSS.)

body, .results {
  position: relative;
}

revised JSFiddle

In case body is not the parent element in your real use case, you just need a wrapper for the .results div with position:relative.