Thursday, July 28, 2016

HTML, CSS - Center Vertically (SLIDE MENU)

HTML:
CSS:
div.container {
    position: relative ;
    width: 250px;
    height: 250px;
    background-color: green;

 }
 
div.left {
    margin: 0;
    background: black;
    opacity: 0.65;
    position: absolute;
    top: 50%;
    transform: translate(-0%, -50%);
   height: 61px;
   width: 38px;
   left: 0px;
}
   
 div.right {
    margin: 0;
    background: black;
    opacity: 0.65;
    position: absolute;
    top: 50%;
    transform: translate(-0%, -50%);
   height: 61px;
   width: 38px;
   right: 0px;
}
   
(jsFiddle demo here)
Credit:
* Centering Things

0 comments:

Post a Comment