CSS3 Multiple Columns and position:absolute
Asked Answered
T

1

7

I'm using CSS3 Multiple Columns. Inner elements have position:relative and can contain arrows with position:absolute.

.clm3{
  -webkit-column-count: 3;
  -moz-column-count: 3;
  column-count: 3;
  -webkit-column-gap: 0;
  -moz-column-gap: 0;
  column-gap: 0;
}

Problem: CSS3 column cut off part of arrow with position:absolute.

Example: http://jsfiddle.net/k4ucr72h/

Tussock answered 13/4, 2015 at 4:38 Comment(6)
What do you expect to happen?Perplexity
I expect that absolute position element will be completely visible and located above all elements without position:absoluteLantha
Yes but absolutely positioned elements are still bound to the borders of their relative container. In this case your labels (.custCheck) have position: relative and that means that the "arrows" won't be able to exceed their limit. I suggest you take the arrows outside of the list, or remove the relative position from the labels, and then locate the arrows with JS.Perplexity
I don't understand. Usually I can move my absolute position element wherever I want outside position:relative parent.Lantha
You can do it, like shown in this example. Unless the relative container has overflow: hidden like shown in this example. I guess the browser simply (and quite logically) makes sure that every column will behave as if it has overflow: hiddenPerplexity
BTW what I've written before about the labels being the boundaries is wrong. The column is the boundary of course. But as I said, if you make the arrows absolute position while the labels won't be, you'll be able to position the arrows where you wantPerplexity
E
11

Try to use this on li items in your column:

.clm3 li {
  -webkit-column-break-inside: avoid;
  -webkit-backface-visibility: hidden; 
}

Also add z-index to .countArrow class:

.countArrow {
  z-index: 1
}
Elene answered 12/1, 2017 at 8:43 Comment(1)
-webkit-backface-visibility: hidden; seems do the trick. Thx.Airman

© 2022 - 2024 — McMap. All rights reserved.