LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code


Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus

CSS
body { color: #eee; }

#nav {
     margin: 40px auto;
     text-align: center;
}
#nav li {
    display: inline;
}
#nav a {
    margin: 10px;
    color: #eee;
    font: bold 20px Sans-Serif;
    text-decoration: none;
}
#login {
    z-index: 2;
}
#login:after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: -1;
    pointer-events: none;
}
#login:hover:after {
    z-index: 1; 
    background: rgba(0,0,0,0.75);
}
#login strong {
    background: green;
    padding: 10px;
}
#login:hover strong {
    position: relative;
    z-index: 2;
    
}
Host Instantly Drag and Drop Website Builder

 

Description

If you don't set relative positioning on an element, absolutely positioned pseudo elements will be positioned relative to the next parent that does. If nothing else does, it will be relative to the root element. You can use that to make a full-browser-window element, stack it underneath the main element, and reveal it on hover making a "page fade out" effect on a link.
Term
Wed, 11/29/2017 - 11:23

Related Codes

Pen ID
Pen ID
Pen ID