Results 1 to 3 of 3

Thread: Width - Blue Blocks Menu

  1. #1
    Join Date
    Dec 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Width - Blue Blocks Menu

    I'm trying to use the DD Blue Blocks vertical menu:

    http://www.dynamicdrive.com/style/cs...e-blocks-menu/

    Coding the width for this menu makes no sense to me. Specifically:

    #ddblueblockmenu li a{
    display: block;
    padding: 3px 0;
    padding-left: 9px;
    width: 169px; /*185px minus all left/right paddings and margins*/


    Clearly there is padding somewhere in this menu I don't understand. As far as I can tell the only left or right padding is "left: 9px" and margins are 0. 185 minus 9 is not 169.

    Similarly, I've read all of the stuff about hacking the box model for IE, but I can't figure out where these widths come from:

    * html #ddblueblockmenu li a{ /*IE only */
    width: 187px; /*IE 5*/
    w\idth: 169px; /*185px minus all left/right paddings and margins*/
    }

    Why 187px and 169px?
    Last edited by Geologist1724; 01-06-2009 at 09:14 PM.

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You have to count the border as well:
    Code:
    padding-left: 9px;
    width: 169px; /*185px minus all left/right paddings and margins*/
    border-left: 7px solid #1958b7;
    
    185 - (9 + 7) = 169
    Why the 187px for IE5 I don't know, don't really think you need it any more though, if anyone has IE5, they should upgrade. The second 169px is to bring it back from 187px. Since stylesheets are cascading, the last bit of code will be implemented and since IE5 doesn't like the escaped w\idth it won't see that, so the width in IE5 will be 187px, again no idea why.
    Last edited by Snookerman; 01-04-2009 at 05:53 PM.

  3. #3
    Join Date
    Dec 2008
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Width Help Thanks

    Thanks Snookerman. That helps and pretty much works. If anyone else is having trouble with this menu I found that I had to change the basic set of code also:

    #ddblueblockmenu{
    border: 1px solid black;
    border-bottom-width: 0;
    width: 185px;
    }

    This width must also be:

    Desired Width (185) minus left/right padding, margins and borders (169px) in this case.


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
  •