Forums

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

Home Forums CSS Floating Problem

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #147712
    _Sven_
    Participant

    Hello everybody,

    I want to create a grid with CSS

    1 3
    2 4

    how can I achieve this with the existing code (see link)

    The structure HTML- must remain so and no JS

    I have already played around a lot, but now my expertise is at the end.
    is that even possible?

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

    #147713
    Paulie_D
    Member

    The structure HTML- must remain so and no JS

    Then you are out of luck with floats…that’s not how they work.

    If you want columns you have to put them in columns.

    http://codepen.io/Paulie-D/pen/yCeLp

    #147714
    _Sven_
    Participant

    Hello Pauli_D,
    thanx for reply…
    I feared it :(

    #147716
    Paulie_D
    Member

    That’s not to say it can’t be done…but it won’t be with floats alone.

    Any other solution is likely to be less flexible.

    Is HTML source order that important in this instance?

    #147720
    _Sven_
    Participant

    Yes, the HTML ist important (unfortunately)
    I tried with floats, with positioning, with child-first… I don’t what else I tried :/ …
    the problem is… there can be several col1 or col2

    1 5
    2 6
    3 7
    4

    or

    1 4
    2 5
    3 6
    7

    so on…

    all DIVs on the left ‘col1′ and on the right ‘col2′

    #147721
    Paulie_D
    Member

    Not well supported but: http://codepen.io/Paulie-D/pen/vkwhD

    #147724
    _Sven_
    Participant

    oh… that’s cool… ok, I will play with it…

    ‘ll get back, thanx :)

    #147745
    wolfcry911
    Participant

    Here’s a pen I created awhile back:

    http://codepen.io/wolfcry911/pen/IkBbu

    #147790
    _Sven_
    Participant

    @wolfcry911 … Thanx :)

    #148005
    _Sven_
    Participant

    Hello Tom… thanx .. . Yes nice Idea but unflexible, I dont’t know exactly how many DIVs will be generate. Sometimes 3 or 5 or 6 in a col, with different columns 1 or 2 or 3 cols …

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