So i have found plenty of code examples of how to do this but none offer a real explaination on how to recreate the example on your own, or use it in your own way. can some one explain this for me. i know i have to assign a position to my div elements and then adjust the z-index to that the content is layered on top of the faded element. ive seen this alot for example:
wrapper {
position: relative;
z-index: 1
}
mid-see-through{
position:absolute;
zindex:2;
}
content {
position: relative;
z-index:3;
}
but this either doesnt work or im implementing it correctly. can someone please help me? my code is below if it helps
css
.page-bg {
margin: 3px 3px;
border: 3px;
padding: 10px 10px;
background-color: gray;
/* ADD A FADED EDGE LATER */
}
#div-wrapper {
position: relative;
}
.content-outer {
position: relative;
margin: 4px;
padding: 2px 2px;
background-color: #222;
/* opacity: .5; */
z-index: 3;
}
.content {
position: relative;
border: #333 inset 3px;
z-index: 4;
}
#div-wrapper .view {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 3;
}
#div-wrapper .content-outer {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
opacity: .4;
z-index: 1;
}
html
<!-- div-wrapper holds background -->
<div id="div-wrapper" class="page-bg">
<!-- content-outer should be transparent -->
<div class="content-outer">
<!-- content should be visible and should be the on-top of content-outer -->
<div class="content">
<h3>
<img class="view" src="blank" alt=" Profile Image" />
</h3>
</div>
</div>
</div>