我有一个divs
页面列表:
<div class="section"><span>Client Information </span>
<!-- Some fields here -->
</div>
<div class="section"><span>Billing Information </span>
<!-- Some fields here -->
</div>
<div class="section"><span>Contact Information </span>
<!-- Some fields here -->
</div>
当用户滚动页面时,我想要Note
在浏览器可见部分的顶部。
<div class="note">Note:Please fill all the required fields</div>
例如
当页面加载并且
Client Infomation
是可见部分时。注释应出现在客户信息部分的顶部。用户向下滚动并且
Billing Information
是可见部分。注意应该出现在账单信息部分的顶部。当用户来到
Contact Information
部分时,注释应该出现在联系信息部分的顶部。如果用户滚动回
Client Information
部分,注释应该出现在客户信息的顶部。
重要 1:注意 div 应该只出现在部分的顶部,而不是重叠部分字段。
我尝试使用
.note {
position:fixed;
width:100%;
z-index:1080;
}
但这使得note div 重叠部分字段,而我没有。
重要 2:部分 div 位于固定导航栏和徽标下方。这样当第一部分可见时。注意 div 必须放在 logo 和第一部分之间。