SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    canada
    Posts
    331
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Which box model hack do you use?

    Here are a summary of the hacks.

    http://css-discuss.incutio.com/?page=BoxModelHack

    I got the Tantek hack to work but not Tantek's midpass hack. Just interested in which one is most popular with current developers.

    Using IETester to validate.

    (I suppose the very best way is to design around the hack altogether.)

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,585
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    To be honest I nevert need to use hacks in my code . Most good ones don't. There just isn't a need .
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  3. #3
    SitePoint Guru Luki_be's Avatar
    Join Date
    Jun 2008
    Location
    Brazil, Minas Gerais. But i'm from Belgium.
    Posts
    867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The box model hack is intended for IE prior to IE6. I wouldn't bother with that old beast....

    But if you still want/need to support that old browser, there shouldn't be a need for the box model hack: the IE box-model problem can be avoided by not assigning problematic properties and values to sized containers. Instead, apply padding and/or margins to the "liquid elements" contained within
    the "sized" elements.

    Code CSS:
    #left-column { 
    width:200px; 
    height:auto; 
    padding:5px; 
    border:3px solid #600; 
    }

    can be replaced with:

    Code CSS:
    #left-column { 
    width:200px; 
    height:auto; 
    }

    Then, you can use a nested div to display the removed attributes:

    Code CSS:
    div.nest { 
    padding:5px; 
    border:3px solid #600; 
    }

    The nested div will flow within the constraints of the parent without causing any spacing issues between the parent div and neighboring elements. (liquid as in a glass of water)

    Of course, you don't need to use a nested div, but you can apply padding to the other elements such as paragraphs, images, lists.
    SitePoint Guru
    Sitepoint - the ultimate Css well
    As a computer, I find your faith in technology amusing.
    Sitepoint reference, your friend in need

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,585
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I think I should mention I did the backslash hack (which is also called in there, the modified SBMH hack (when I bothered with it a long time ago))
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work


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
  •