/* Method 1 */
.a {
width: 200px;
height: 200px;
background-color: black;
color: #fff;
display:flex;
justify-content:center;
flex-direction:column;
}
/* Method 2 (Working in all browsers )*/
.a {
height: 150px;
width: 240px;
background-color: black;
color:white;
display:table;
}
.a p {
display:table-cell;
vertical-align: middle;
}
/* Method 3 */
outer {
width: 200px;
height: 200px;
background-color: black;
color:white;
position: relative;
}
.inner {
height: 50px;
width: 50px;
background-color: red;
position: absolute;
top: 50%;
transform:translateY(-50%);
}