Forums

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

Home Forums CSS Fixed-width center column, non-fixed sides.

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

    Hello. Hi. Its late. I’m tired. Please help.

    Ok, so this is a really simple problem i’m having. Or atleast, it should be simple, but my brain is fried and i can’t get it to work the way i want it.

    Basically i want 3 columns. The center column needs a fixed width of 900px, but the two side columns need to expand their sizes based on the size of the users screen, and be equal with eachother. Each side column is having a separate background image (left column bg image aligned to the right, right column bg image aligned to the left).

    Like this: image

    I don’t want to retrieve the user’s screen size myself if i don’t have to. I also don’t want to use tables.

    I swear i’m not an idiot. I’m just tired, and a google search did not give me the right answer. I can’t believe its not possible to do purely in css, it must be. I just can’t think of the solution.

    Plaaeesee.. Haalp.

    #207478
    Paulie_D
    Member

    Easy with flexbox.

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

    Of course, you’ll need to see it full screen.

    #207481
    Paulie_D
    Member
    #207482
    bearhead
    Participant

    You can also use display:table-cell; if you need deeper browser support:

    http://codepen.io/kvana/pen/zvxYEX

    I would probably recommend one of Paulie_D’s solutions if you don’t need to worry about ie8 or 9 though…

    #207588
    Jagiero
    Participant

    Excellent replies! Thanks everyone!

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