How do I align text to the middle of an element with CSS in Twitter Bootstrap?

后端 未结 3 928
情书的邮戳
情书的邮戳 2021-02-06 01:41

I am using Bootstrap alerts and this is my success alert message:


      
3条回答
  •  南旧
    南旧 (楼主)
    2021-02-06 02:23

    Make the line-height of the div the same as the height of the div, eg:

    #UploadSuccess { height: 20px; line-height: 20px; }
    

    This will only work if you have one line of text.

提交回复
热议问题