https://www.verswerks.com/crowd_staffer/
在屏幕右侧是我正在使用的内容。我不能让标签独立移动而不用拉动其余部分。我明白这可能是因为他们被包裹在ul中,但是有人可以建议一种方法来解决这个问题吗?
#top_links{
font-family: 'Swanky and Moo Moo', cursive;
margin-right: 50px;
text-align: right;
}
ul#navigation {
position: fixed;
margin: 0px;
padding: 0px;
top: 30%;
right: 0px;
list-style: none;
z-index:9999;
}
ul#navigation li {
width: 100px;
height: 30px;
padding: 10px;
background: rgb(167,199,220); /* Old browsers */
background: -moz-linear-gradient(top, rgba(167,199,220,1) 0%, rgba(133,178,211,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(167,199,220,1)), color-stop(100%,rgba(133,178,211,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(167,199,220,1) 0%,rgba(133,178,211,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(167,199,220,1) 0%,rgba(133,178,211,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(167,199,220,1) 0%,rgba(133,178,211,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(167,199,220,1) 0%,rgba(133,178,211,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a7c7dc', endColorstr='#85b2d3',GradientType=0 ); /* IE6-9 */
-moz-border-radius:10px 0px 0px 10px;
-webkit-border-bottom-left-radius: 10px;
-webkit-border-top-left-radius: 10px;
-khtml-border-bottom-left-radius: 10px;
-khtml-border-top-left-radius: 10px;
-moz-box-shadow: 0px 4px 3px #000;
-webkit-box-shadow: 0px 4px 3px #000;
box-shadow: 0px 4px 3px #000;
opacity: 0.6;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=60);
}
ul#navigation li a{
color: black;
}
<nav id='top_links'>
Login | Contact us
</nav>
<section>
<ul id="navigation">
<li>Inspire!</li>
<li class="right_slideout"><a href="" title="Home">Home, back to our blah blah</a></li>
<li class="right_slideout"><a href="" title="About">About our blah blah</a></li>
<li class="right_slideout"><a href="" title="Search">Search for blah blah</a></li>
</ul>
</section>
$(function() {
$('.right_slideout').hover(
function () {
$(this).animate({width:300},"fast");
},
function () {
$(this).animate({width:100},"fast");
}
);
});
答案 0 :(得分:2)
我找到了一个有效的解决方案。 将此添加到您的li css:
float: right;
clear: both;
这将个别李贴在右侧,并使用clear来启动另一条线上的下一个li。 在jsfiddle和你的页面上测试过并且工作过。