css svg iconinfo显示问题

查看:97
本文介绍了css svg iconinfo显示问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

如何调整svg大小

.item-after {
        white-space: nowrap;
        color: @color-text-secondary;
        .flex-shrink(0);
        margin-left: 0.25rem;
        .flexbox();
        max-height: 1.4rem;
    }



item-after效果:

现在我想把12部分替换成图标:

样式该怎么改

<div class="item-after">
                        <svg class="icon">
                            <use xlink:href="#icon-wenhao"></use>
                        </svg>
                    </div>

.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
}

设置color无效是什么原因

解决方案

设置svg的width和height就行

这篇关于css svg iconinfo显示问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆