Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Hi,

In the following source code,the content area is displayed below the background image but i want the content area to be displayed inside the background image .how to do it?




Following is my source code:


XML
<!DOCTYPE HTML>
<html>
<head>
<title>SlideShow</title>
<style>
#wrapper {width: 900px; margin:0 auto; background-color:#00FF00;
            }
#container {
    height:auto;
    margin:0 auto;
    padding:0 0 20px;
    width:751px;
    background-color:#00FFFF;}
#slideshow img {
-webkit-border-radius: 20px;
    -khtml-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
    box-shadow: 2px 2px 5px #888888;
}
</style>

<script>
var image1 = new Image();
image1.src ="Images/first.jpg";
var image2 = new Image();
image2.src = "Images/second.jpg";

</script>
</head>
<body>

<div id="wrapper">
<div id="slideshow">
<img src="Images/first.jpg" alt="" name="MySlide" width=900; height=200 />
<div id="container" style="height: 104px">
<h1>It is the Content Area</h1>
</div>
</div>

</div>

<script>
var step=1
function SlideShow()
{
if(!document.images)
return
document.images.MySlide.src=eval("image"+step+".src")
if(step<4)
step++
else
step=1
setTimeout("SlideShow()",3000)
}
SlideShow()


</script>
</body>
</html>
Posted

1 solution

If you want to place your background images as a slideshow, then you need to have the z-index property of that element inside your css file.

So in your case, it should be like ->

CSS
#slideshow {
   position: absolute;
   z-index: -99999px;
}


Hope This Helps You.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900