# How to overlap some text with a div on toggle?

**URL:** <https://www.ruby-forum.com/t/how-to-overlap-some-text-with-a-div-on-toggle/82486>\
**Category:** Rails\
**Created:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/how-to-overlap-some-text-with-a-div-on-toggle/82486 "2007-01-19T16:30:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [January 19, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/how-to-overlap-some-text-with-a-div-on-toggle/82486/1 "2007-01-19T16:30:50Z")

</div>

Hey all,

I use a toggle effect this way:

\<%= link\_to\_function “edit this item”, “Element.toggle(‘editdiv’)” %\>

blabla   
blabla   
blabla   
blabla   

  
roror   
roror   
roror   

that works great but I would like the content of editdiv to overlap  
the text that comes next, in other words I want blabla to overlap  
roror because for now, when I click on “edit this item”  
, roror goes down to make room for blabla.  
Any idea how to do this?

thanx in advance

Pat

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [January 19, 2007, 4:31pm UTC](https://www.ruby-forum.com/t/how-to-overlap-some-text-with-a-div-on-toggle/82486/2 "2007-01-19T16:31:43Z")

</div>

Patrick A. schrieb:

> the text that comes next, in other words I want blabla to overlap  
> roror because for now, when I click on “edit this item”  
> , roror goes down to make room for blabla.  
> Any idea how to do this?

For overlapping you must use the z-index css property and the div must  
have an absolute position.

Tobias

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [September 25, 2007, 10:45pm UTC](https://www.ruby-forum.com/t/how-to-overlap-some-text-with-a-div-on-toggle/82486/3 "2007-09-25T22:45:47Z")

</div>

ok thanx a lot.  
I came up with something like this:

blabla   
blabla   
blabla   
blabla   

roror   
roror   
roror
