Safari spacing out my UL/LI's for some odd reason...

Discussion in 'CSS' started by 5thround, Oct 11, 2009.

  1. #1
    I'm trying to re-design my website and in Firefox, IE & Opera my UL's look fine (shown in picture below)
    [​IMG]

    but in Safari my UL's come out like this:
    [​IMG]

    Do you have any suggestions as to how I can fix the spacing that Safari has on my UL's?

    The code for the UL's is:
    #headlines ul {
    	list-style:none;
    	margin-left: 0.5em;
    	padding-bottom: 5px;
    }
    
    
    #headlines li {
    	background-repeat: no-repeat;
    	background-position: 0 0.4em;
    }
    Code (markup):
    Thanks for taking the time to look at my question!
     
    5thround, Oct 11, 2009 IP
  2. 5thround

    5thround Active Member

    Messages:
    126
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #2
    I believe I just fixed the issue by placing display: inline; within the #headlines ul code. The issue now is the height between the links in Safari still.
     
    5thround, Oct 11, 2009 IP
  3. jordanthegreat

    jordanthegreat Active Member

    Messages:
    390
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Make sure to declare all margin's and padding (top, right, bottom and left) for both ul's and li's. Browsers usually have default margins AND padding set for ul's AND li's. That should fix your problem and you should be able to take out the display:inline.
     
    Last edited: Oct 12, 2009
    jordanthegreat, Oct 12, 2009 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That they do. As do other elements, which is why I use a reset at the top of my CSS file.

    Here it is, for those who want a handy reference:

    
    /* GLOBAL RESET STYLE RULES */
    
    	html, body, address, blockquote, button, dd, del, div, dl, dt, fieldset,
    	form, h1, h2, h3, h4, h5, h6, hr, ins, map, object, ol, p, pre, table,
    	tbody, td, tfoot, thead, tr, ul {
    		margin: 0;
    		padding: 0;
    		vertical-align: baseline;
    	}
    
    	body {
    		background: #FFF;
    		color: #111;
    		font: 85%/1.5 verdana, arial, helvetica, sans-serif;
    	}
    	
    	a {
    		background: transparent;
    		color: #00F;
    	}
    	
    	a:visited {
    		color: #909;
    	}
    	
    	a:hover, a:focus, a:active {
    		color: #F00;
    		text-decoration: none;
    	}
    
    	fieldset {
    		border: 0;
    		display: inline;
    	}
    
    	h1, h2, h3, h4, h5, h6 {
    		font: bold 1em/1.5 georgia, garamond, "times new roman", times, serif;
    	}
    
    	hr {
    		position: absolute;
    		left: -999em;
    	}
    
    	img {
    		border: 0;
    		vertical-align: bottom;
    	}
    	
    	object {
    		vertical-align: bottom;
    	}
    
    Code (markup):
     
    Dan Schulz, Oct 12, 2009 IP