First look at Html code for header sidebar
<li class="top-cart">
<div class="block-title">
<strong id="cartHeader"><a href="http://lifemore.svn-test.com/index.php/checkout/cart/">shopping bag (<span>1</span>)</a></strong>
</div>
<span class="icon"></span>
<div class="block-content" id="topCartContent">
<div class="inner-wrapper"> <p class="block-subtitle">
<span class="close-btn" onclick="Enterprise.TopCart.hideCart()">Close</span>
Recently added item(s) </p>
Add this style to the css file will make it active.
<style>
.top-cart .block-content {
display: none;
}
.top-cart:hover .block-content {
display: block;
}
</style>
HTML购物车头部悬浮效果
本文介绍了一种使用HTML和CSS实现的购物车图标头部悬浮显示效果。通过:hover伪类控制.top-cart类的block-content显示与隐藏,实现当鼠标悬停在购物车上时显示购物车内商品详情的功能。
1158

被折叠的 条评论
为什么被折叠?



