4

I have a div with some content in it which includes a ul with a list of names the div tag has overflow set to hidden and height :auto so that it increases in height with the content .However i have a ul with a list of names and i want the list to go outside the box . something like the facebook add people autocomplete . The people list shows outside the box

heres my syntax

   <div>

    <!-- content goes here -->

    <ul><!-- names go here --> </ul>


    </div>

updated

<div><!-- div with overflow set to hidden-->

<ul class="selected"></ul><!-- ul containing selected elements-->

<ul class="users"></ul> <!-- list of users -->


</div>

div{overflow:hidden}

.selected{overflow:hidden}

.users{position:absolute}

I need the users div to go outside the box but because the parent div is set to overflow hidden it gets cut off. I cannot remove the overflow hidden because as the div with class selected gets more elements the parent div wont expand

Neil
  • 2,802
  • 8
  • 34
  • 49

3 Answers3

1

No. You simply cannot.

jsBin demo shows that you cannot 'push-out' from an overflow:hidden element an inner children. The answer would be: don't use overflow:hidden; .

Or: you might want to check THIS answer

Community
  • 1
  • 1
Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313
  • ok thank you .then my next question would be how would i get the parent container to expand as elements are added to the ul with class selected – Neil Jun 16 '12 at 13:47
0

Try adding position: relative to ul.

Demo: http://jsfiddle.net/57NmY/

codef0rmer
  • 10,284
  • 9
  • 53
  • 76
0

It can be done, if you position the child element absolutely. -> http://jsfiddle.net/joplomacedo/CX5n9/

João Paulo Macedo
  • 15,297
  • 4
  • 31
  • 41