带下划线的CSS3过渡

带下划线的CSS3过渡,第1张

带下划线的CSS3过渡

这是一个非常棘手的问题。

唯一的解决办法我能想出是过渡

border-bottom
:hover
或我其实应该说我过渡
border-bottom
width
margin-right
border-bottom
出现,并在同一时间保持,在这种情况下,链接对齐

很难解释,所以我举了一个简短的例子,它并不完美,看起来有些混乱,但至少可以说明我的意思。:-)

HTML

<a href="#">link</a><a href="#">link</a>

的CSS

a {    text-decoration: none;    display: inline-block;    border-bottom: 1px solid blue;        margin-right: 39px;     width: 0px;    -webkit-transition: 0.5s ease; transition: 0.5s ease;}a:hover {    -webkit-transition: 0.5s ease; transition: 0.5s ease;    border-bottom: 1px solid blue;    width: 30px;    margin-right: 9px;}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5150024.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-18
下一篇 2022-11-18

发表评论

登录后才能评论

评论列表(0条)

保存