I want to place a div over another. I asked this the other day and someone explained how z-index works (he or she said: "Element with a larger z-index number will cover an element with a smaller one")
I have now added another two divs and cant get the fourth one (the footer of my "document"/website) to be on top of the others
Here is the other's day question/thread: How to place a div over another
Someone asked what I wanted to do. I am just starting and following a basic course. The last "asignment" is to create a resume.
Here is theirs (example):
https://i.stack.imgur.com/xLgMM.png
However, I wanted to change it a bit.
I don't want any margins on the page (e.g. left of their blue left bar), I don't want rounded corners, and I don't want spaces between the divs. That is, I want all my "site" covered by color:
A beige-pinkish (#F5F0EC) on the background, a pink header, a grey footer and then a lighter grey as a margin on the left, on top of all of them.
This is what I have so far in my css:
#header {
width: 106%;
background-color: #E8D5C6;
height: 100px;
margin-top: -8px;
margin-left: -8px;
position: absolute;
z-index: 2;
}
.left {
width: 15px;
background-color: #919191;
height: 695px;
margin-left: -8px;
margin-top: -8px;
position: relative;
z-index: 3;
}
.right {
width: 106%;
background-color: #F5F0EC;
height: 695px;
margin-left: -8px;
margin-top: -8px;
position: relative;
margin-top: -645px;
z-index: 1;
}
#footer {
width: 106%;
background-color: #404145;
height: 50px;
margin-left: -8px;
position: relative;
z-index: 4;
}
Looks like my footer div is below the background (the "right" one with the color #F5F0EC), and I want it to be on top of it. And then, the left grey bar I want it on top of both of them (or all of them)
Tried ordering the elements with z-index: 1, z-index: 2, etc. but doesn't seem to work.