www.webdeveloper.com
Results 1 to 7 of 7

Thread: width or min-width

  1. #1
    Join Date
    Aug 2004
    Location
    70 klicks above the Do Lung bridge
    Posts
    654

    width or min-width

    Hi guys. I'm just wondering when I should use width and when I should use min-width. I thought there wasn't really a difference but after a day messing around with a site layout trying to get stuff to fit together... I gueass I was wrong.

  2. #2
    Join Date
    Oct 2006
    Location
    Cardiff, Wales, UK
    Posts
    48
    Well, the main difference is that older browsers (IE6 and earlier I think) don't recognize the min-width feature. Try looking at this article too - http://www.mezzoblue.com/archives/20...5/sidestepping - it describes how to overcome this.

    Also min-width is fluid when the window size is larger than your set value, whereas width is simply fixed.
    Last edited by timdenty; 05-29-2007 at 06:32 AM.
    Tim Denton

    Graphic Designer for web, multimedia and interactive in Cardiff, Wales, UK.

    http://www.timdenton.co.uk

  3. #3
    Join Date
    Aug 2004
    Location
    70 klicks above the Do Lung bridge
    Posts
    654
    Cheers. I have a site that's needing a complete redesign. I laid it out with absolutely positioned divs, and now I'm being asked to center it all. I guess that's what I get for cutting corners eh?
    Lesson learned!

  4. #4
    Join Date
    Oct 2006
    Location
    Cardiff, Wales, UK
    Posts
    48
    Just a thought - You could still use absolute positioning & have it center aligned. You would just have to have all your elements within a container which was relatively positioned with correct margins like this...

    margin: 0 auto;
    position: relative;

    The child elements then take their position from the parent element (container), not the body.
    Tim Denton

    Graphic Designer for web, multimedia and interactive in Cardiff, Wales, UK.

    http://www.timdenton.co.uk

  5. #5
    Join Date
    Aug 2004
    Location
    70 klicks above the Do Lung bridge
    Posts
    654
    Cheers Tim. That sure does beat the hell out of a complete re-coding.
    Much appreciated!

  6. #6
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    using absolute positioning unless elements are to overlap is unnecessary and just makes the coding much more complex. You can't centre absolutely positioned elements because they are positioned relative to a single location, not multiple locations..
    Stephen

  7. #7
    Join Date
    Aug 2004
    Location
    70 klicks above the Do Lung bridge
    Posts
    654
    Really the layout I'm after can be put into 3 columns. It's not as tidy to code as I would have preferred but I've just gone with 3 floating columns and I just need to work out the positioning of things.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles