简体   繁体   中英

Putting something on top of a modal (Zurb Foundation)

I want a div to appear on top of a Zurb Foundation reveal modal.

However, my div refuses to be shown on top of the modal.

The z-index of the modal is 1006. When I set my on-top div to 1010, or even 99999, it still sits underneath the modal.

The only way I can get it to work is by setting the foundation modal's .reveal-overlay 's z-index to 0 (even 1 puts it on top of my div), but that messes up other elements.

How can I put an element on top of a Zurb Foundation modal?

Your div needs to on the top level of the dom for this to work.

The following will work.

<div class="reveal">
<h1>my reveal</h1>
</div>

<div style="z-index: 1100; width:500px; height: 500px; 
top: 100px; position: absolute;left: 200px;">On top of the reveal</div>

</body>
</html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM