Back Home

Open Designs

Community. Driven.

    •  
      CommentAuthorJeremyD
    • CommentTimeMar 27th 2007
     

    :D anyway----

    I've asked this at least 182301923 times, but I can't remember. How do you get rid of that margin that FF automatically puts to the left of lists?

    my css is like so:

    #sidebar_left ul{
    margin:0px;
    }
    #sidebar_left li{
    list-style:none;
    display:block;
    padding:2px 0 2px 10px;
    color:#333333;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    text-decoration:none;
    font-size:12px;
    background-color:#CCCCCC;
    border-bottom: 1px solid #B7B7B7;
    margin: 0px;
    }

    but I keep getting that pesky margin. Oddly enough, if i combine the li and ul style (sidebar_left ul,li{ etc; etc;}) It removes the margin in IE7 bu makes it bigger in FF...
    • CommentAuthorMattKern
    • CommentTimeMar 28th 2007
     
    I am working on one right now and this seems to do the trick.

    ul{
    list-style:none;
    margin-left:0px;
    padding:1px;
    }
    •  
      CommentAuthorJeremyD
    • CommentTimeMar 28th 2007
     
    that fixed it. thanks bakie
    • CommentAuthorMattKern
    • CommentTimeMar 28th 2007
     
    Its rare that i am on the giving end of these things...
    • CommentAuthorEcko
    • CommentTimeMar 28th 2007
     
    Put this code at the beginning of every CSS document.
    * { padding: 0; margin: 0; }
    It should set all automatic margins to 0 in both FF and IE.
    •  
      CommentAuthorJJenZz
    • CommentTimeMar 29th 2007 edited by JJenZz on the 29th March 2007 at 05:52:27 EDT
     
    Yup, its padding and margin on the UL... just set them both to "0" on the UL and it fixes the problem.

    I've never been keen on the idea of that * { padding: 0; margin: 0; } thing... some default settings are useful IMO.
    •  
      CommentAuthorsnop
    • CommentTimeMar 29th 2007
     
    The * trick has screwed me a few too many times. Seems like a good idea in theory, but then I always end up with these bizarre positioning bugs.
  1.  
    yeah I try and avoid such *hacks* wherever possible.. and that include browser specific hacks... I just don't like them!
    • CommentAuthorslickopr1
    • CommentTimeApr 4th 2007
     
    Doesn't that *hack* over ride the default browser's CCS? That way the site will display almost the same in each browser.
    •  
      CommentAuthorgnome
    • CommentTimeApr 4th 2007 edited by gnome on the 04th April 2007 at 18:05:52 EDT
     
    I use the hack normally, although the new design I am working on does not.