我已经制作了一个JSFiddle来尝试展示我的想法,但基本上我想在整个网站下面有一个隐藏的背景,并且当链接被悬停时,通过透明边框显示这个背景。我无法弄清如何隐藏背景并仍能在悬停期间在边框中显示它。
以下是我目前所拥有的。
任何想法?
以下是我目前所拥有的。
body {
background-image: url("http://img05.deviantart.net/7fa2/i/2015/185/2/1/neon_rainbow_stripes_by_wolfy9r9r-d8zv7ba.png");
background-repeat: repeat;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
}
li {
float: left;
}
li a {
display: block;
color: #666;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
color: #222;
border-bottom: 1px solid transparent;
}
.overlay {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
background: #FFF;
z-index: 10;
}
.content {
position: relative;
z-index: 15;
}
<div class='overlay'></div>
<div class='content'>
<ul>
<li><a>Nav 1</a>
</li>
<li><a>Nav 2</a>
</li>
<li><a>Nav 3</a>
</li>
<li><a>Nav 4</a>
</li>
</ul>
</div>
border-image
吗? - Mr_Green