Forums

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

Home Forums CSS Seems like a simple fix but im drawing a blank, floating elements!

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #44507
    JohnMotylJr
    Participant

    Hey folks,

    I want all of my floating divs to line up, but my two middle divs are causing a problem resulting in my far right “blue” div to get nudged down.

    Here is the CodePen, thanks for any suggestions.

    I feel that i could just make a container in the middle to hold my B & C elements, however, i feel that there could be a more elegant solution.

    #133895
    Paulie_D
    Member

    That the normal behaviour.

    The divs load in order and use their assigned widths. If they can’t fit into the remaining space they drop down…but they can’t float up further than the previous element

    #133900
    JohnMotylJr
    Participant

    @Paulie_D, thanks for the explanation (knowledge is everything). Appreciate the response, do you think adding a middle container would equate to un-needed markup?

    I added an extra div to act as a wrapper (giving the wrapper the % width).

    CodePen

    #133903
    CrocoDillon
    Participant

    You can pull it in place with `margin-top: -30px;`, or probably relative positioning.

    #133905
    JohnMotylJr
    Participant

    @CrocoDillon, thanks man.. Taking a month off made me forget the simplest of simple things.. lol thanks again croco and paulie :)

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