How do I vertically align something inside a span tag?

后端 未结 9 1091
情话喂你
情话喂你 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:49

    this works for me (Keltex said the same)

    .foo {
    height: 50px;
    ...
    }
    .foo span{
    vertical-align: middle; 
    }
    
     middle!
    

提交回复
热议问题