我用下面的代码箱阴影到左
.header .menu-item {
margin: 0 15px;
list-style: none;
font: 500 16px Poppins, sans-serif;
text-transform: lowercase;
display: inline;
}
.header .menu-item a,
.header .menu-item a:visited {
display: inline-block;
width: auto;
padding: 0 10px;
line-height: 110%;
color: #000;
text-decoration: none;
-webkit-box-shadow: inset 0px 0px 0px 0px rgba(0,0,0,1);
-moz-box-shadow: inset 0px 0px 0px 0px rgba(0,0,0,1);
box-shadow: inset 0px 0px 0px 0px rgba(0,0,0,1);
-webkit-transition: box-shadow ease-in-out 0.2s;
-moz-transition: box-shadow ease-in-out 0.2s;
transition: box-shadow ease-in-out 0.2s;
}
.header .menu-item a:hover,
.header .menu-item a:focus{
color: #000;
text-decoration: none;
-webkit-box-shadow: inset 0px -7px 0px 0px rgba(0,0,0,1);
-moz-box-shadow: inset 0px -7px 0px 0px rgba(0,0,0,1);
box-shadow: inset 0px -7px 0px 0px rgba(0,0,0,1);
}
<div class="header">
<ul class="menu">
<li class="menu-item"><a href="#">Home</a></li>
<li class="menu-item"><a href="#">Contato</a></li>
</ul>
</div>
到目前为止,这正是我多么希望。除了因为我想从右到左出现悬停效果。我怎么能用箱子阴影来做到这一点?
按照布局有一个想法。
我打破我的头,但没有得到任何东西
如果你有这另一种解决方案,只要他们不使用的图像,我会感激不尽。
非常感谢
他要求从右到左,而不是从左到右。 –
编辑:)对不起,我没有阅读,因为我在我的工作:) –
正是这样。谢谢! :) –