首页 新闻 会员 周边 捐助

CSS:请问怎么让我这里的文本垂直居中?

0
[待解决问题]

请问怎么让我这里的文本垂直居中?
Html:
Html:

   <script src="//at.alicdn.com/t/font_wucl02m681zia4i.js" type="text/javascript"></script>
    
    <div id="postMeta">
            <!-- 博文分类 -->
            <a rel="nofollow noopener" href="https://www.cnblogs.com/iMath/category/1107555.html" id="catogory">
             <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-fenlei2"></use>
             </svg>
          </a>
            <!-- 阅读统计 -->
            <div id="postViewCount">
             <svg class="icon" aria-hidden="true">
                 <use xlink:href="#icon-yuedu1"></use>
             </svg>
             <span class="post_view_count">5531</span>
             </div>
            <!-- 发布日期 -->
            <div>
                <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-history"></use>
             </svg>
                <span class="post-date">2018-06-25</span>
            </div>
            <!--  编辑 -->
            <a rel="nofollow noopener" href="https://i.cnblogs.com/EditPosts.aspx?postid=9223247">
             <svg class="icon" aria-hidden="true" id="icon-bianji">
                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-bianji4"></use>
             </svg>
          </a>
        </div>

CSS:

#postMeta{
  display: flex;
  justify-content: space-around;
  align-items: center;
/*   height:100px; */

}
iMath的主页 iMath | 初学一级 | 园豆:124
提问于:2023-01-09 17:08
< >
分享
所有回答(1)
1

<script src="//at.alicdn.com/t/font_wucl02m681zia4i.js" type="text/javascript"></script>

<div id="postMeta">
        <!-- 博文分类 -->
        <a rel="nofollow noopener" class="align-center" href="https://www.cnblogs.com/iMath/category/1107555.html" id="catogory">
         <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-fenlei2"></use>
         </svg>
      </a>
        <!-- 阅读统计 -->
        <div id="postViewCount" class="align-center">
         <svg class="icon" aria-hidden="true">
             <use xlink:href="#icon-yuedu1"></use>
         </svg>
         <span class="post_view_count">5531</span>
         </div>
        <!-- 发布日期 -->
        <div class="align-center">
            <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-history"></use>
         </svg>
            <span class="post-date">2018-06-25</span>
        </div>
        <!--  编辑 -->
        <a rel="nofollow noopener" class="align-center" href="https://i.cnblogs.com/EditPosts.aspx?postid=9223247">
         <svg class="icon" aria-hidden="true" id="icon-bianji">
            <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-bianji4"></use>
         </svg>
      </a>
    </div>

<style>

postMeta{

display: flex;
justify-content: space-around;
align-items: center;
/* height:100px; */

}

#postMeta .align-center{
 display: flex;
justify-content: space-around;
align-items: center;
}

</style>

 | 园豆:216 (菜鸟二级) | 2023-01-09 17:43

多谢!在你的启示下我主要用了·svg {
vertical-align: middle;
}·解决了!

支持(0) 反对(0) iMath | 园豆:124 (初学一级) | 2023-01-09 20:26
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册