Grow your CSS skills. Land your dream job.

Is it ok to re-position elements outside their div?

  • # March 29, 2013 at 10:56 am

    I have a div 100x200px wide. I placed a logo inside that div and re-positioned using position:absolute the logo is outside the div on the screen, but it still acts as if its inside. is that something that acceptable to do?

    # March 29, 2013 at 11:01 am

    Of course! That is the beauty of absolutely positioning.

    # March 29, 2013 at 12:12 pm

    I think I might take a look at my existing layout *first* and see if there is something more fundamental I am doing incorrectly or poorly before just slapping a position:absolute on it. In my experience there is typically a better way to do something before resorting to absolute positioning. But that’s just me.

    # March 29, 2013 at 12:44 pm

    >In my experience there is typically a better way to do something before resorting to absolute positioning.

    I tend to agree, without seeing what it is you are doing..and why it’s tough to offer alternative options.

    Perhaps a small Codepen?

    # March 29, 2013 at 6:46 pm

    @Paulie_D here you go. The “Harol.com” text is inside the wrapper div. But i positioned it way above. Even when its still inside the div. I know i could have placed it inside the header but i wanted it to align perfectly with the bottom content. I didn’t link the images and a few things are out of place. [pen](http://codepen.io/Jarolin/pen/sboLH “”)

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".