I have been reading forums all night & still can't figure this one out.
I want to have one of my divs as the background for everything else in my site. I also want it to start from a particular spot, i.e. it doesn't take up the whole page.
This div (class the_background) is a child of my container div which is a child of the body, as follows:
head tag(Usual stuff in here)closing head tag
<body>
<div class="container">
<div class="header">
<img src="images/open-access/header.png">
</div>
<br/>
<div class="signout">
login name | <a href="#">signout</a>
</div>
<br/>
<div class="menu">
<ul>
<li><a href="#">Bunch of links etc.</a></li>
</ul>
<div class="under_menu">
</div>
</div>
<div class="welcome">
Welcome, name!
</div>
<div class="the_background"></div>
etc.
The following is the code for my external stylesheet:
.container {margin:0 2em;
text-align: center;
position: relative;}
(bunch of code, and then:)
.under_menu{background-color: rgb(141, 0, 212);
width:auto;
height: 1em;
padding-bottom: 0;}
.the_background{background-color: yellow;
background-image: url('images/bg.png');
width: auto;
height: 100%;
background-size: cover;
z-index: -10;
position: absolute;
left: 0;}
(bunch more code, etc.)
What I eventually want (as I can't post images) is for the background image to begin at the bottom of the under_menu div, to occupy the same width as it too, and to continue for the rest of the length of the page. At the moment, the under_menu div is perfect- it goes across the whole page but for a small margin at each side (of 50%) and is a nice slim height of 1em.
This code as I've currently copied it gives me nothing. Why on earth is that so???!!! I have been playing with this ALL day, and managed to get either the yellow fallback colour or the background image to display at certain times, but I cannot for the life of me control its width or height. I have tinkered with EVERY relevant property that I can identify! If someone could please help me I would be all kinds of grateful. If someone could also please explain why the code I have pasted there doesn't work, that would be great too.
Thank you very very much in advance!!!
p.s. yes I have been triple checking spelling & syntax etc. :/