How do I vertically align something inside a span tag?

后端 未结 9 1095
情话喂你
情话喂你 2020-11-28 18:52

How do I get the \"x\" to be vertically-aligned in the middle of the span?

.foo {
    height: 50px;
    border: solid black 1px;
    display: inline-block;
          


        
9条回答
  •  春和景丽
    2020-11-28 19:39

    The flexbox way:

    .foo {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 50px;
    }
    

提交回复
热议问题