[英]Restrict an element's height but show the bottom part instead of the top
用这个:
#bar ul { margin:0; font-weight:700; position:absolute; bottom:8px; }
你可以把箭头放在顶部。 然后,将:hover
高度向下调整2em,并在<ul>
上添加一个-2em的上边距用于悬停; 这将有效隐藏悬停时的箭头。
列表看起来像这样:
<ul>
<li>↓</li>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
更新的CSS将是:
#bar:hover { height: 8em; }
#bar:hover ul { margin-top: -2em; }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.