# How to "float" layouts/partials so that they stay in a static position in the browser?

**URL:** <https://www.ruby-forum.com/t/how-to-float-layouts-partials-so-that-they-stay-in-a-static-position-in-the-browser/189579>\
**Category:** Rails\
**Created:** [June 3, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/how-to-float-layouts-partials-so-that-they-stay-in-a-static-position-in-the-browser/189579 "2010-06-03T14:59:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lille](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@Lille](https://www.ruby-forum.com/u/Lille)\
**Post date:** [June 3, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/how-to-float-layouts-partials-so-that-they-stay-in-a-static-position-in-the-browser/189579/1 "2010-06-03T14:59:56Z")

</div>

Hi,

Anybody know how to “float” an element like a partial so that it stays  
in the same position relative to the browser window frame?

(My motivation: I’d like to have certain elements always in view no  
matter where the user scrolls on the page.)

Thanks,

Lille

---

<div class="post-metadata">

**Author:** ![Lille](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@Lille](https://www.ruby-forum.com/u/Lille)\
**Post date:** [June 3, 2010, 3:09pm UTC](https://www.ruby-forum.com/t/how-to-float-layouts-partials-so-that-they-stay-in-a-static-position-in-the-browser/189579/2 "2010-06-03T15:09:53Z")

</div>

css + position fixed  
google it

Ivan N.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Lille](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@Lille](https://www.ruby-forum.com/u/Lille)\
**Post date:** [June 3, 2010, 3:23pm UTC](https://www.ruby-forum.com/t/how-to-float-layouts-partials-so-that-they-stay-in-a-static-position-in-the-browser/189579/3 "2010-06-03T15:23:21Z")

</div>

[http://tinyurl.com/253tgp8](http://tinyurl.com/253tgp8)

(hint to Ivan, use [http://lmgtfy.com/](http://lmgtfy.com/) - it’s great for links like this  
🙂 )

–  
Andy J.  
[http://andyjeffries.co.uk/](http://andyjeffries.co.uk/)#rubyonrails #mysql #jquery  
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS  
Company number: 5452840
