How to center multiple inline-block elements with CSS?

Simply set text-align: center; on the div container.


Set text-align: center; on the parent element.


have you tried the following?

div{
   text-align:center;
}

Either you can try these one

div{
   text-align:center;
}

or set margin auto as shown below

div a{
  margin:auto;
  margin-left:1em;
  margin-right:1em;
  margin-top:1em;
  margin-bottom:1em;
 display:inline-block;
}

A good example is shown here