overline css,html - CSS, Text-Decoration: Overline - Stack Overflow

本文探讨了如何使用CSS实现hover状态下文字上方的过线效果,并希望调整过线与文字间的间距。当前的问题在于过线直接贴合文字顶部,缺乏足够的间距。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I'm trying to create an overline effect on hover with css. What I have so far is below. Here's the problem I have, the over line appears directly above the text. I want there to be some space b/w them. Here is my site: http://baycity2014.weebly.com, and here's the effect I'm going for: http://www.hartlevin.com. Any advice?

CSS:

#nav-wrap .container {

clear: both;

overflow: hidden;

position: relative;

}

#nav-wrap .container {

/*background:url(nav-bg-medium.jpg) repeat-x top;*/

/*height:45px;*/

}

#nav-wrap .container ul {

list-style: none;

}

#nav-wrap .container ul li {

list-style: none;

float: left;

/* background:url(nav-saperator-medium.jpg) no-repeat right;*/

padding-right:2px;

}

#nav-wrap .container ul > li:first-child a,

#nav-wrap .container ul > li:first-child a:hover,

#nav-wrap .container ul span:first-child li a,

#nav-wrap .container ul span:first-child li a:hover{

border-radius:5px 0px 0px 5px;

}

#nav-wrap .container ul li a {

float: left;

display: block;

font-family: 'Helvetica', san-serif;

color: #000;

padding: 0px 30px;

border: 0px solid;

outline: 0;

list-style-type: none;

font-size: 16px;

line-height:45px;

/*text-shadow: 0px -1px 0px #333333;*/

}

#nav-wrap .container ul li:hover {

/*background:url(nav-saperator-hover-medium.jpg) no-repeat right;*/

}

#nav-wrap .container ul li a:hover {

/*background:url(nav-bg-hover-medium.jpg) repeat-x top ;*/

color: #145D85;

text-decoration:overline;

}

HTML:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值