【发布时间】:2018-11-14 23:13:28
【问题描述】:
我这里有点问题。
我正在使用 Ionic 3。
我有一个带有加号的圆形按钮。当我增加加号font-size 时,它会强制按钮更宽as you can see here。我尝试过设置max-width 和!important 以及许多其他的东西,但它们什么也没做。
Here is what it looks like unscaled
.btnAddImage {
background: rgba(255, 255, 255, 0.3);
width: 150px;
height: 150px;
color: #4E4E4E;
font-size: 100px;
border-radius: 50%;
}
<div text-center>
<button ion-button class="btnAddImage">+</button>
</div>
我的目标是有一个带有大加号的圆形按钮。
干杯,祖克
【问题讨论】:
-
你的目标是什么?加号较大的圆形按钮?
-
是的,@benni 这就是我想要的
-
@zuke 添加类名到 div "text-center"
-
可能是因为按钮上有自然的填充和边框使其拉长 - 尝试将
box-sizing: border-box添加到按钮。如果这不是问题,请您提供minimal reproducible example,因为您提供的代码似乎可以正常工作(在 chrome 中) -
您不能使用代码 sn-p,因为我使用的是 ionic。我在想也许我应该只使用一张图片,
box-sizing: border-box;没有用。
标签: html css ionic-framework ionic3