Em đang học html/css trên codecademy, đến đoạn này em đọc thì không kiểu lắm, nhờ anh chị nào dịch hộ em. Em xin cảm ơn ạ.
Relative positioning
Good! Did you notice how the#inner
div moved 20 pixels in from the edge of the#outer
div? That’s absolute positioning at work.Relative positioning is more straightforward: it tells the element to move relative to where it would have landed if it just had the default static positioning.
If you give an element relative positioning and tell it to have a margin-top of 10px, it doesn’t move down ten pixels from any particular thing—it moves down ten pixels from where it otherwise would have been.