hi, check the top navbar of my site i need the link to have same distance from the image here's the css <style type="text/css"> #top_menu { background:url('/images/top_menu_bg.png') 0 0 repeat-x; } #top_menu ul { margin:0; padding:0; list-style-type:none; } #top_menu ul li { float:left; } #top_menu ul li a { background:url('/images/top_menu_item_bg.png') 16px 6px no-repeat; } #top_menu ul li a:hover { color:#EBD687; } </style> Code (markup): what should i edit?
Add padding-left:20px 20px being whatever much you want into #top_menu ul li a so it should look like #top_menu ul li a { background:url('/images/top_menu_item_bg.png') 16px 6px no-repeat; padding-left:20px; } edit: Actually, I'm a bit confused now. You want SOME distance or all of them to have same distance..cause from my browser, they look like they all have the same distance.
You need to look at what you code is doing for the top menu... #top_menu { height: 30px; background: url(http://casino-list.net/images/top_menu_bg.png) repeat-x; padding-left: 20px; } #bottom_menu a, #top_menu a { float: left; width: 140px; margin-right: 20px; padding-top: 7px; padding-bottom: 5px; color: #fff; font-weight: bold; font-family: Tahoma, san serif; text-align: center; text-transform: uppercase; } #top_menu { background:url('http://casino-list.net/images/top_menu_bg.png') 0 0 repeat-x; } #top_menu ul { margin:0; padding:0; list-style-type:none; } #top_menu ul li a { background:url('images/top_menu_item_bg.png') 16px 6px no-repeat; Code (markup): You got your text align centered so of course it's going to look like everything is off of the image file. just remove text-align:center off the #top_menu a selector then put a padding-left enough to just push it a bit right of the image file. Actually, wait that won't work. You have a float in there which will force the links all the way to the left anyways. Who the hell created that code anyways? It's all backwards. Read this on how to make menu lists: http://css.maxdesign.com.au/listamatic/