gpt4 book ai didi

css - css 文本上方的边距或填充

转载 作者:行者123 更新时间:2023-11-28 12:21:32 25 4
gpt4 key购买 nike

我正在处理这个页面:

enter image description here

我正在尝试让第一个下拉项显示在距主菜单稍远的位置;说大约是第一和第二滴线之间距离的一半。原因是当鼠标悬停在第一个下拉线上时,很容易让鼠标回到主菜单。

/* ================================================================ 
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

最佳答案

只需将 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/

关于css - css 文本上方的边距或填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13777686/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com