Forums

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

Home Forums CSS Where I made a mistake with position:absolute

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40139
    Derper
    Member

    Hi!

    I’m building a slider for my website, and I need to add buttons which will be above the content.

    But I’ve run into some strange issue (most likely it’s just my lack of knowledge).

    How it should look: http://codepen.io/anon/pen/ikcno (without buttons)
    As you can see elements have symmetric 20px margin on the left/right sides from the wrapper.

    But when I add buttons (with position:absolute) http://codepen.io/anon/pen/iFCyc

    Everything goes weird, I lost margin on the right and on the left margin becomes too large.

    How to properly add buttons? Thanks

    #111252
    soren
    Member

    I’m not 100% sure this is the solution but I just placed the left-arrow div above the right-arrow div in your HTML.

    http://codepen.io/anon/pen/jGLzg

    #111254
    Derper
    Member

    Soren, I’m think this is the solution because this issue was probably caused by :first-child selector. Thanks.

    #111255
    soren
    Member

    :) no problems. only solutions.

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