Adding a background image to a DIV. Image must have low opacity, but the other elements in the DIV must have normal opacity.
I was following this SO answer (answer's Codepen is here).
However, I must be doing something wrong (knowing me, something painfully obvious). Can anyone spot my mistake, or suggest the solution?
In case my above jsFiddle someday disappers, here is my code:
HTML:
<div id="loginFormDIV">
<div id="headerDIV">
<p>Login Please</p>
</div>
<div id="formDIV">
<div id="fd_loginDIV">
<p>Login ID:</p>
<input id="fd_login" type="text" />
</div>
<div id="fd_pwordDIV">
<p>Password:</p>
<input id="fd_pword" type="password" />
</div>
<div id="fd_submitDIV">
<input id="fd_submit" type="button" value="Submit" />
</div>
</div>
</div><!-- #loginForm -->
CSS:
* { margin: 0; padding: 0; outline: 0 }
html {min-height:100%;margin-bottom:1px;font-size: 62.5%;background:#eaeaea;}
h1, h2, h3 {color:#f1f0ee;font-family:Segoe UI Light, Arial, Verdana, Geneva, sans-serif;font-family:"Segoe UI light","Segoe UI";}
h1 {font-size:2.5em;font-weight:normal;border-bottom:0px solid #c6beaa;padding-bottom:25px;}
#loginFormDIV {height:250px;width:400px;position:absolute;left:30%;font-size:1.6em;z-index:10;}
#headerDIV {height:40px;width:100%;background:white;}
#formDIV {height:210px;width:100%;position:relative;}
#formDIV:after{content:'';display:block;position:absolute;top:0;left:0;background:url(http://placekitten.com/400/250);background-size:cover;opacity:0.2;z-index:-2;}
#fd_loginDIV {height:35%;width:80%;margin:0 auto;border:1px solid blue;}
#fd_pwordDIV {height:35%;width:80%;margin:0 auto;border:1px solid red;}
#fd_submitDIV {height:25%;width:35%;float:right;border:1px solid orange;}
#fd_loginDIV p{}
#fd_pwordDIV p{}
#fd_login {height:40px;width:60%;}
#fd_pword {height:40px;width:60%;}
#fd_submit {}