Forums

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

Home Forums CSS Responsive design question – make divs align horizontal & switch to vertical

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #201490
    cssflunkie
    Participant

    On a desktop device I need 4 columns to align left to right horizontally and then switch to vertically aligned on a mobile device. There are only 2 employee records, I need the right div to move under the div directly to its left to form a single column as below. Any thoughts on how to set up the divs to accomplish this? Thanks

    Desktop view…

    Primary: 555-555-1212 Type: Home
    Alternate: 555-555-1414 Type: Work

    Mobile view…

    Primary:
    555-555-1212
    Type:
    Call

    Alternate:
    555-555-1414
    Type:
    Text

    #201495
    Paulie_D
    Member

    Perhaps you could show us the issue in a Codepen demo.

    It’s much easier to advise on code we’ve actually seen than work from vague requests.

    #201537
    wahhabb
    Participant

    Although you call these columns, they actually look like table entries. You can do what you need by using flexbox. See https://css-tricks.com/snippets/css/a-guide-to-flexbox/.

    #201539
    Paulie_D
    Member

    Easy enough even without flexbox but I’m not sure what you are going for exactly.

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

    After that it’s just a matter of media queries.

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