Css 尝试使用Flexbox垂直居中

Css 尝试使用Flexbox垂直居中,css,flexbox,Css,Flexbox,我正在创建一个简单的页脚,并希望其中的所有文本垂直居中。我尝试了几种方法,但都不奏效: footer { height: 50px; width: 100%; bottom: 0; position: fixed; background-color: lightgray; flex: display; flex-direction: column; justify-content: center; justify-items

我正在创建一个简单的页脚,并希望其中的所有文本垂直居中。我尝试了几种方法,但都不奏效:

footer {
    height: 50px;
    width: 100%;
    bottom: 0;
    position: fixed;
    background-color: lightgray;
    flex: display;
    flex-direction: column;
    justify-content: center;
    justify-items: center;
    align-items: center;
    align-content: center;
    text-align: center;
    color: blue;
}

水平居中效果很好。垂直对中有什么不对?

您有
flex:display应该是
显示:flex

当您进行此调整时,您将看到它符合您的要求