Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS about positions (left right top bottom) easy

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31298
    ylex1
    Participant

    Hi I just wanna ask, why is that sometimes when I look at css written by other people there’s a property called left or right …?
    Not margin-left, not padding-right just left or just right?
    thanks

    #65355
    Johnnyb
    Member

    You use top, bottom, left and right to specify the position of an element which is positioned absolutely (position: absolute). So for example, bottom: 0px on an absolute element would put it at the bottom of a parent element which has position: relative, or if there aren’t any relative parents then it will position it relative to the browser window.

    #65342
    Rob MacKay
    Participant

    yup it is the correct way to position elements :)

    as Johnny said you have absolute, relative fixed and static.

    Absolute is relative to a parent element that is positioned – else to the browser

    Relative is relative to it’s actual normal rendered position, so if you left the positioning at 0 you would see no change but if you change it, it will move from that default position.

    Fixed is fixed to the browser window, so if you have something 10px from the top it would be 10px from the top even if you scroll

    and Static is the default :)

    #65199
    ylex1
    Participant

    OOOOOhh, ok, thanks guys!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.