Cleaned up the markup a bit, and applied display: flex
in a parent DIV.container
(see links below, specially), and used center
flex CSS properties.
.container {
display: flex;
justify-content: center;
align-items: center;
}
.inlineflex {
display: inline-flex;
}
You may face problems in IE10 and below, other browsers are good (see caniuse link)
References: