Grow your CSS skills. Land your dream job.

align these divs in single line without breaking

  • # May 4, 2013 at 2:24 pm

    How can i align these divs one after the other without them breaking one ontop of the other and without using position:?http://codepen.io/Jarolin/pen/dcGxv

    # May 4, 2013 at 2:55 pm

    Depends on what you are trying to do.

    Why is floating &/or position a problem?

    # May 4, 2013 at 3:06 pm

    HTML:

    CSS:

    .slide-container {
    white-space: nowrap;
    }

    .slide {
    width:1000px;
    height:100px;
    background-color:red;
    margin:10px;
    display: inline-block;
    }

    And there you have it.

    # May 4, 2013 at 3:09 pm

    @Merri that didn’t work. I updated the pen with your styles and there was no change.

    @Paulie_D you can add position:relative but don’t want actual positioning with numbers.

    # May 4, 2013 at 3:46 pm

    @Jarolin Did you notice the changes in HTML?

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".