[Solved] Center horizontally absolute div in another floating div [closed]


These are the css elements you need to change:

.right {
    width: 200px;
    height: 100%;
    background-color: green;
    float: right;
    position: relative; //here
}
.messageWrapper {
    overflow: hidden;
    bottom: 0;
    max-height: 100%;
    min-height: 20px;
    width: 170px;
    text-align: center; //here
    width: 100%; //here
    position: absolute;  //here
}

.message {
    min-height: 20px;
    background-color: yellow;
    margin-left: auto; //here
    margin-right: auto; //here
    margin-bottom: 5px;
    width: 80%; //here
}

And a working fiddle: http://jsfiddle.net/a1Lp2o52/

0

solved Center horizontally absolute div in another floating div [closed]