2

我正在处理这个页面:

在此处输入图像描述

我试图让第一个下拉项目显示在离主菜单更远的地方;说大约是第一条和第二条下降线之间距离的一半。原因是当鼠标悬停在第一条下拉线上时,很容易让鼠标回到主菜单。

/* ================================================================ 
This copyright notice must be untouched at all times.

The original version of this stylesheet and the associated (x)html
is available at http://www.cssplay.co.uk/pro_dropline7.html
Copyright (c) 2005-2008 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any 
way to fit your requirements.
=================================================================== */

#dropline {position:relative; font-size:13px; height:40px; background:url(http://test.garlandcountydemocrats.org/MASTER_files/back.gif);}

#dropline, #dropline ul {padding:0; margin:0; list-style:none; width:1080px;}

#dropline table {border-collapse:collapse; margin:-1px -10px; 0 0; padding:0; width:0; height:0; font-size:13px;}
#dropline li {float:left; height:40px; margin-right:1px;}
#dropline li a {float:left; display:block; height:40px; line-height:19px; padding:0 20px 0 10px; font-family:arial, sans-serif; font-size:13px; color:#fff; text-decoration:none; font-weight:bold; text-align:center;}
#dropline li a.down {background:background:url(http://test.garlandcountydemocrats.org/MASTER_files/down.gif) no-repeat right center;}
#dropline li ul li a.down {font-size:15px; color:#ff0; font-weight:normal;}

#dropline li a:hover {white-space:nowrap; color:#444;}
#dropline li a.down:hover {white-space:nowrap; color:#444; background:background:url(http://test.garlandcountydemocrats.org/MASTER_files/down-over.gif) no-repeat right center;}

#dropline li:hover > a {color:#4AEF03;}
#dropline li:hover > a.down {color:#4AEF03; background:url(http://test.garlandcountydemocrats.org/MASTER_files/down-over.gif) no-repeat right center;}

#dropline li ul {position:absolute; top:38px; left:-9999px; z-index:10; background:url(http://test.garlandcountydemocrats.org/MASTER_files/sub-back.png) left top;}
#dropline li ul.floatRight li {float:right;}

#dropline :hover ul,
#dropline :hover ul :hover ul,
#dropline :hover ul :hover ul :hover ul,
#dropline :hover ul :hover ul :hover ul :hover ul,
#dropline :hover ul :hover ul :hover ul :hover ul :hover ul {left:0; background:url(http://test.garlandcountydemocrats.org/MASTER_files/sub-back.png) left bottom;}

#dropline :hover ul ul,
#dropline :hover ul :hover ul ul,
#dropline :hover ul :hover ul :hover ul ul,
#dropline :hover ul :hover ul :hover ul :hover ul ul {left:-9999px; top:38px; background:transparent;}

I've tried several different variations on the css code shown below without success.  I'm a total newbie so any help will certainly be appreciated.  Thanks in advance. Hozey
4

1 回答 1

1

只需添加padding-top#dropline li ul

CSS:

#dropline li ul {position:absolute; padding-top:14px; top:38px; left:-9999px; z-index:10; background:url(http://test.garlandcountydemocrats.org/MASTER_files/sub-back.png) left top;}

演示:http: //jsfiddle.net/CGctj/1/

于 2012-12-08T14:13:15.407 回答