【发布时间】:2021-10-10 07:53:34
【问题描述】:
我已经定义了以下 CSS 类
.tiles .tile > a {
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
align-items: center;
justify-content: center;
transition: background-color 0.5s ease, transform 0.5s ease;
position: absolute;
top: 0;
margin-left: auto !important;
margin-right: auto !important;
max-width: 300px;
width: 100%;
height: 100%;
padding: 1em;
border-radius: 4px;
border-bottom: 0;
color: #FFFFFF;
text-align: center;
text-decoration: none;
z-index: 3; }
但是,margin-right: auto 和 margin-left: auto 没有被考虑在内(有或没有!important,所以我的标签没有居中。
是因为柔韧吗?
你知道是什么原因造成的吗?
谢谢!
【问题讨论】: