SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Sep 2009
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Confusion with max-width and min-width

    I have two inline-blocks with their own max/min-width. I want them to respond to with the width of the wrapper they are contained in, which changes depending on browser window size. However right now these two inline-blocks automatically adjust to the min-width size and that's it.

    Now, if I change them to "block" they adjust in size properly but they are no longer inline. Any suggestions on what I may be doing wrong or how to best address this?

    http://estevancarlos.kodingen.com/dadev1/
    http://estevancarlos.kodingen.com/da...andingpage.css

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,218
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by rpeg View Post
    I want them to respond to with the width of the wrapper they are contained in
    You are probably better off using % widths in that case. Make sure to design these columns along with the whole page, so that things are all in harmony. Set a max and min width for the page container and work your way in from there.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2009
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Regarding the issue, are you recommending % widths because it's easier or because it's the only option? I just want to make sure I understand what's at hand.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,218
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by rpeg View Post
    are you recommending % widths because it's easier or because it's the only option?
    It's not the only option, but the best one I'm aware of. You could also use display: table &co, but I don't find that's a very good option for page layout.

  5. #5
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,806
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    The thing to know here inline elements cant have dimensions. You will need to float the elements or use display:inline-block;

    as has been said before, you will find that it makes more sense to apply min/max width on the container.

    hope that helps


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •