Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class='container'>
- <div class='background'><img src='/img/url/here.jpg' /></div>
- <div class='foreground'>Overlay copy</div>
- </div>
- .container {
- position: relative; /* this is required to keep all absolutely positioned child elements contained */
- overflow: hidden;
- height: 100px;
- width: 1200px;
- }
- .background {
- position: absolute;
- left: -200px;
- top: 0;
- height: 100px;
- width: 1200px;
- z-index: 1;
- }
- .foreground {
- position: absolute;
- left: 50px;
- top: 50px;
- height: 50px;
- width: 300px;
- z-index: 2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement