I am trying to create a basic style sheet with a background, and a form in the middle.
With the code I have, the background shows but the form is not visible. When all is said and done, the only HTML I will need will be text inside the form. But for now, I need the form to display. I am sure it is a mental error on my part, but here is the code:
<head>
<title>Basic Form</title>
<style type="text/css">
body
{
background-image:url('images/background.png');
}
#main{
background: url('/images/form.png') 0 0 no-repeat;
margin:250px auto;
z-index: 1;
}
</head>
<body>
<div id="main">
</div>
</body>
</html>
You have not set any dimensions for #main, so the width and height are auto.
That div has no content, so the height becomes
0.With no height, there is no visible area to render a background image on.