Skip to main content

Lil CSS Help 1111 Responses

Last post: 11 months, 2 weeks ago | Thread started: Jul 5, 12, 10:07 a.m.

RespondNew TopicDisable Images

  • ESKEMA

    how do I make firefox (and perhaps ie, didn't tested it yet) to perform a position: fixed based on the parent and not the browser? in Safari and Chrome I simply don't input x and y and it locks fixed at the top left corner of its parent. I want to replicate this in firefox and probably others. How do I do this? I want to know!

    Jul 5, 12, 10:07 a.m. – Permalink
  • dbloc

    relative

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 10:21 a.m. – Permalink
  • BabySnakes

    http://www.w3schools.com/cssref/…

    Fixed is to the browser window, you may want to use relative on the parent and absolute on its children.

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 10:22 a.m. – Permalink
  • 303

    #parent {
    position: relative;
    }

    #child {
    position: absolute;
    top: 0;
    left: 0;
    }

    • Or set right / bottom; pich and mix3031/2
      <ideaist2/2
    next note >+ add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 10:23 a.m. – Permalink
  • ESKEMA

    ^this will make it scroll vertically. I want it fixed vertically, but to move horizontally acording to it's parent..

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 10:39 a.m. – Permalink
  • 303

    Any online examples that you have in mind?

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 10:41 a.m. – Permalink
  • ESKEMA

    I want this in FF...
    http://balas.pt/stuff/fixed.html…

    • have to see in Safari or Chrome..ESKEMA
    + add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 10:50 a.m. – Permalink
  • ESKEMA

    hmm.
    seems the problem lies elsewhere because this lil html that I put up works in FF.. have to dig deeper..

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 10:55 a.m. – Permalink
  • uan

    that even works in ie8 :)

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 10:59 a.m. – Permalink
  • 303

    Works for me in FF and Chrome on Mac.
    However, the element has position: fixed. At the moment, there are no props for left/top so it looks fine against the red box. Once those are set, black box is positioned relative to the browser window.

    If you don't like (or can't use) position: fixed you might use some JS plugins (ie jQuery) to the the job for you. You can use window.resize event then to adjust position accordingly.

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 11:01 a.m. – Permalink
  • ESKEMA

    well, I played with the code a little, and something must have been named wrong because it works now.. woot woot!

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 11:03 a.m. – Permalink
  • ESKEMA

    </thread>

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earJul 5, 12, 11:04 a.m. – Permalink

Login or Register to respond to this

Skip to main content