离子框架无法设置按钮图标大小

问题描述 投票:9回答:4

我想为此代码设置自定义图标(ionicons)大小:

<button class="button button-icon icon ion-stop customIconSound"></button>

对于class customIconSound我试过以下:

button.customIconSound,button.button-icon {
    font-size: 52px !important;
    color: #fff;
    line-height: 55px!important;
}

但没有运气。如果我尝试没有按钮按钮图标类的图标类,我认为它正在工作,但没有按钮类图标没有按下状态(因为它不是按钮)。

我该怎么解决呢?

谢谢你的建议。

css3 icons ionic-framework ionic
4个回答
15
投票

卢卡斯很接近,但正确的语法是这一个

button.customIconSound:before {
    font-size: 22px !important;
}

6
投票

如果你还没有解决你的问题或将来处理它的人。

你必须改变i伪元素的css样式:之前

button.customIconSound i:before {
    font-size: 52px !important;
}

3
投票

你的例子是here

也许你的问题是由别的东西引起的。

PS:如果你只想调整图标大小这个css就足够了。

.customIconSound {
    font-size: 52px;
}

0
投票

试着统治button-icon课程。那个css课就是我的麻烦。同样,因此,css样式也适用于按钮标签。例如:

<button class="button button-clear ion-edit" style="color:#fff; font-size:22px"></button>
© www.soinside.com 2019 - 2024. All rights reserved.