Forums

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

Home Forums CSS Codepen: Problem with absolute positioning

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #286783
    Cicada
    Participant

    Hello people! I am new to using codepen and came across a small issue that is giving me a headache. I created 3 divs, 3 squares one being red, blue and yellow. When the positioning of each div is set to relative, I get to see the 3 squares, but when i change it to relative i can only see one square (usually the last div. Any ideas what it can be? thankyou. My code

    /HTML/

    /CSS/
    .red{
    height: 100px;
    width:100px;
    background-color:red;
    position: relative;
    }

    .blue{
    height: 100px;
    width:100px;
    background-color:blue;
    position: relative;
    }

    .yellow{
    height: 100px;
    width:100px;
    background-color:yellow;
    position: relative;
    }

    #286787
    Paulie_D
    Member

    And where is the Codepen?

    If you mean change it to absolute rather than relative…then they are all sitting on top of each other becuase you haven’t told them to be anywhere else.

    https://learnlayout.com/

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