<script src="https://raw.github.com/LeaVerou/prefixfree/gh-pages/prefixfree.min.js"></script>
<!-- Used for centering my example -->
<div class='container'>
<!-- This is our banner the content will pull up over -->
<!-- The class isn't even required, just using it for decoration -->
<img src='http://placekitten.com/400/220' class='banner'>
<!-- This is the div that will pull up over the banner -->
<!-- It's class also adds some decoration -->
<div class='overlay'>
<!-- This content div just adds padding for the text -->
<!-- We add padding to an inner div so as not to stretch the parent -->
<div class='content'>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</div>
</div>
</div>
CSS
/* Give the page a nicer background */
body {
background-color: #CCCCCC;
}
/* Center my example and push it off the top of the page */
.container {
width: 400px;
margin: 30px auto;
}
/* Pull the overlay up over the banner */
.overlay {
/* Don't take up the full width */
width: 90%;
/* Give the content a see thru white background, default to solid white in old browsers */
background: #FFFFFF;
background: rgba(255, 255, 255, 0.7);
/* Center the content */
margin: 0 auto;
/* Pull the content up over the banner */
margin-top: -100px;
/* Using this will make sure that it goes over the element, not under */
/* This is the magic line that fixes most z-index issues */
position: relative;
/* More pointless pretty code */
border-radius: 8px;
}
/* Make the content look pretty */
.banner {
border-radius: 6px;
}
.content {
padding: 12px;
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.