A similar question has been asked many times (how to place text over an image) but every solution says make a relative positioned container and place image and text inside.
But what if the container needs to be absolute??
I want the image to be absolute in order to span the full width of the page, without being limited by the wrapper's width: Wrapper has set width, the image container should ignore this and be full screen, and the text should float above the image.
Here is a fiddle in which the image isn't ignoring the wrapper's width
.splash_image { position: relative; left: 0; top: 2%; height: 600px; overflow: hidden; z-index: 1; } .splash_image img { width: 100%; position: absolute; } .splash_title { color: red; position: absolute; } .wrapper { width: 50%; } <div class="wrapper"> <div class="splash_image"> <img src="http://fc07.deviantart.net/fs34/f/2008/290/6/4/Large_Tree_Stock_by_HauntingVisionsStock.jpg" alt="test image"> <div class="splash_title">Test title to go here on image</div> </div> </div>
position: relativefrom.splash_image