treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Fluid Layout Inline-Block Issues

  • Hi everyone,

    After a very long frustrating time of it I turn to your all in your infinite wisdom for help:

    I have started a new design and intend to build a fluid layout that will re-size and format for all resolutions much like CSS-Tricks. I have two div elements that I would like to display along side each other. The first div on the left contains an image, the second on the right, some text.

    For resolutions between say 1980px wide and 1200px I would like the image to stay the same size and the div containing the text to shrink in width whilst maintaining its position and the text wraps.

    However no combination of min and max widths or display options is helping me.

    I can paste code but I though a live demo would be best:

    http://silvermandesign.co.uk/sartuition/index.html

    As you can see (or those of you with a 1980px wide monitor or more), the text moves below the image and only wraps when the window width restricts it.

    I'm sure all of that is as clear as mud but I do hope you can help.
  • It might be easier for you to place the image within the same div as the body copy and float it to the left.
  • That would be a solution for one page yes, but what for a 2 or three column layout?
  • This sounds like you need to float the image div left and the text div right and set a min-width / max width on the image div.

    Adjust per media queries. Wouldn't that work?
  • Hi Guys,

    Thanks for you comments. As usual having started with a fresh mind this morning I came to a solution or at least work around quite quickly.
    I have indeed ended up using floats as well as window width dependant style sheets.

    Two elements re-sizing both with % widths is fine but essentially I wanted to elements to resize at different rates and that was less possible.

    Thanks again!
    S