我正在为客户的网站制作一个徽标网格。我想知道如何使它们在行和列的网格中居中。我有css:
.center-block {
display: block;
margin-top: auto;
margin-bottom: auto;
margin-left: auto;
margin-right: auto;
}
如果有任何解决方案,请告诉我。
答案 0 :(得分:0)
如果您希望徽标水平居中,您可以执行以下操作,并将.center-me替换为您想要居中的元素的类。
如果是块元素,请执行此操作。
.center-me {
margin: 0 auto;
}
如果是内联(文本或链接),请执行此操作
.center-me {
text-align: center;
}