CSS Positioning Help: Z-index
-
My basic problem is that I would like to position some text over the picture banner. I would like the text to be adjustable from each page, however; meaning that you can go to home and write something special there, and then write something different for the ‘about’ page, etc. The way I think I could be able to do this is put whatever text I want in <h1> tags, and then position <h1> in the stylesheet.
However, my text keeps disappearing under the picture.
Is my problem my layering of divs? I have several divs inside of one another, and the text I want on top of the picture is probably going to be inside of the ‘content’ div.
<div class="border"> <!-- IMAGE I WANT UNDER EVERYTHING, but over the 'border' div --> <img src="http://spba.stanford.edu/images/2_2.jpg"> <div class="container"> <div class="content"> <!-- TEXT I WANT OVER EVERYTHING --> <div style="position: relative;"> <div style="position: absolute; top: -50px; left: 0; z-index: 5;"> <h1>1st Header</h1> </div> </div> <p> <h2>2nd Header</h2> <p>This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.</p> <p>SPBA. SPBA.</p> <br /><br /> </div> <div class="sidebar"><b>Join us!</b> <br />Send an email to prebusiness-join@lists.stanford.edu <!-- <br />Enter your email address below and click Subscribe to join our mailing list. <p><input type="text" id="emailaddress" /> <input type="button" value="Subscribe" onClick="document.getElementById('subscribed').innerHTML = 'Sending request...'; joinSPBA(document.getElementById('emailaddress').value)" /></p> <p id="subscribed"></p> --> <br /><br /> </div> </div> </div>
The topic ‘CSS Positioning Help: Z-index’ is closed to new replies.